Files
swayipc/_examples/tree/main.go

25 lines
290 B
Go
Raw Normal View History

2025-08-14 14:16:17 +02:00
package main
import (
"log"
"github.com/alecthomas/repr"
"github.com/tlinden/i3ipc"
)
func main() {
ipc := i3ipc.NewI3ipc("SWAYSOCK")
err := ipc.Connect()
if err != nil {
log.Fatal(err)
}
tree, err := ipc.GetTree()
if err != nil {
log.Fatal(err)
}
repr.Println(tree)
}