Files
swayipc/_examples/get_marks/main.go

30 lines
347 B
Go
Raw Normal View History

2025-08-14 14:16:17 +02:00
package main
/*
Retrieve a list of current set marks
*/
2025-08-14 14:16:17 +02:00
import (
"log"
"github.com/alecthomas/repr"
"github.com/tlinden/i3ipc"
)
func main() {
ipc := i3ipc.NewI3ipc()
2025-08-14 14:16:17 +02:00
err := ipc.Connect()
if err != nil {
log.Fatal(err)
}
defer ipc.Close()
2025-08-14 14:16:17 +02:00
marks, err := ipc.GetMarks()
2025-08-14 14:16:17 +02:00
if err != nil {
log.Fatal(err)
}
repr.Println(marks)
2025-08-14 14:16:17 +02:00
}