Files
swayipc/_examples/get_workspaces/main.go
2025-11-10 20:59:46 +01:00

30 lines
381 B
Go

package main
/*
Retrieve a list of current available workspaces
*/
import (
"log"
"github.com/alecthomas/repr"
"codeberg.org/scip/swayipc/v1"
)
func main() {
ipc := swayipc.NewSwayIPC()
err := ipc.Connect()
if err != nil {
log.Fatal(err)
}
defer ipc.Close()
workspaces, err := ipc.GetWorkspaces()
if err != nil {
log.Fatal(err)
}
repr.Println(workspaces)
}