update dependencies, add linter config, satisfy linter

This commit is contained in:
2026-08-22 21:14:45 +02:00
parent 5f392e9d60
commit 12794946a1
6 changed files with 187 additions and 9 deletions

10
main.go
View File

@@ -28,7 +28,7 @@ import (
"github.com/alecthomas/repr"
)
const VERSION = `v0.0.3`
const VERSION = `v0.0.4`
func main() {
if len(os.Args) > 1 {
@@ -54,7 +54,7 @@ func main() {
// first, retrieve the whole sway root node
root, err := ipc.GetTree()
if err != nil {
log.Fatal(err)
log.Fatal(err) // nolint:gocritic
}
// get the hidden scratchpad workspace
@@ -78,8 +78,9 @@ func main() {
func retrieveWindow(ipc *swayipc.SwayIPC, scratch *swayipc.Node, id int) {
// make sure the id exists
var exists bool
for _, con := range scratch.FloatingNodes {
if con.Id == id {
if con.ID == id {
exists = true
}
}
@@ -95,13 +96,12 @@ func retrieveWindow(ipc *swayipc.SwayIPC, scratch *swayipc.Node, id int) {
repr.Println(responses)
log.Fatal(err)
}
}
func listScratchedContainer(scratch *swayipc.Node) {
// list the windows
for _, con := range scratch.FloatingNodes {
fmt.Printf("%d %s\n", con.Id, con.Name)
fmt.Printf("%d %s\n", con.ID, con.Name)
}
}