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

27 lines
338 B
Go

package main
import (
"fmt"
"log"
"codeberg.org/scip/swayipc/v1"
)
func main() {
ipc := swayipc.NewSwayIPC()
err := ipc.Connect()
if err != nil {
log.Fatal(err)
}
tree, err := ipc.GetTree()
if err != nil {
log.Fatal(err)
}
workspace := tree.FindCurrentWorkspace()
fmt.Printf("current workspace: %s\n", workspace)
}