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

30 lines
360 B
Go

package main
/*
Retrieve a list of current available inputs
*/
import (
"log"
"github.com/alecthomas/repr"
"github.com/tlinden/swayipc"
)
func main() {
ipc := swayipc.NewSwayIPC()
err := ipc.Connect()
if err != nil {
log.Fatal(err)
}
defer ipc.Close()
seats, err := ipc.GetSeats()
if err != nil {
log.Fatal(err)
}
repr.Println(seats)
}