2025-08-14 22:59:38 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
This example toggles borders globally for all windows, execute
|
|
|
|
|
multiple time to see the toggling.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"log"
|
|
|
|
|
|
|
|
|
|
"github.com/alecthomas/repr"
|
2025-11-10 20:59:46 +01:00
|
|
|
"codeberg.org/scip/swayipc/v1"
|
2025-08-14 22:59:38 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2025-08-16 19:50:30 +02:00
|
|
|
ipc := swayipc.NewSwayIPC()
|
2025-08-14 22:59:38 +02:00
|
|
|
|
|
|
|
|
err := ipc.Connect()
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Fatal(err)
|
|
|
|
|
}
|
2025-08-15 12:16:08 +02:00
|
|
|
defer ipc.Close()
|
2025-08-14 22:59:38 +02:00
|
|
|
|
|
|
|
|
responses, err := ipc.RunGlobalCommand("border toggle")
|
|
|
|
|
if err != nil {
|
|
|
|
|
repr.Println(responses)
|
|
|
|
|
log.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
}
|