Files
swayipc/_examples/get_inputs/main.go

30 lines
365 B
Go
Raw Normal View History

package main
/*
Retrieve a list of current available inputs
*/
import (
"log"
"github.com/alecthomas/repr"
2025-11-10 20:59:46 +01:00
"codeberg.org/scip/swayipc/v1"
)
func main() {
2025-08-16 19:50:30 +02:00
ipc := swayipc.NewSwayIPC()
err := ipc.Connect()
if err != nil {
log.Fatal(err)
}
defer ipc.Close()
inputs, err := ipc.GetInputs()
if err != nil {
log.Fatal(err)
}
repr.Println(inputs)
}