Files
swayipc/_examples/run_global_command/main.go

30 lines
455 B
Go
Raw Normal View History

package main
/*
This example toggles borders globally for all windows, execute
multiple time to see the toggling.
*/
import (
"log"
"github.com/alecthomas/repr"
2025-08-16 19:50:30 +02:00
"github.com/tlinden/swayipc"
)
func main() {
2025-08-16 19:50:30 +02:00
ipc := swayipc.NewSwayIPC()
err := ipc.Connect()
if err != nil {
log.Fatal(err)
}
defer ipc.Close()
responses, err := ipc.RunGlobalCommand("border toggle")
if err != nil {
repr.Println(responses)
log.Fatal(err)
}
}