mirror of
https://codeberg.org/scip/sway-descratch.git
synced 2026-08-23 22:34:23 +02:00
update dependencies, add linter config, satisfy linter
This commit is contained in:
10
main.go
10
main.go
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user