Files
swayipc/_examples/current_workspace/main.go
2025-08-16 19:50:30 +02:00

27 lines
336 B
Go

package main
import (
"fmt"
"log"
"github.com/tlinden/swayipc"
)
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)
}