mirror of
https://codeberg.org/scip/swayipc.git
synced 2025-12-16 12:10:57 +01:00
implemented more stuff along with samples
This commit is contained in:
24
_examples/get_tree/main.go
Normal file
24
_examples/get_tree/main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user