mirror of
https://codeberg.org/scip/swayipc.git
synced 2025-12-16 12:10:57 +01:00
27 lines
338 B
Go
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)
|
|
}
|