2025-08-14 14:16:17 +02:00
|
|
|
package main
|
|
|
|
|
|
2025-08-14 22:59:38 +02:00
|
|
|
/*
|
|
|
|
|
Retrieve the wm version
|
|
|
|
|
*/
|
|
|
|
|
|
2025-08-14 14:16:17 +02:00
|
|
|
import (
|
|
|
|
|
"log"
|
|
|
|
|
|
|
|
|
|
"github.com/alecthomas/repr"
|
|
|
|
|
"github.com/tlinden/i3ipc"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2025-08-14 22:59:38 +02:00
|
|
|
ipc := i3ipc.NewI3ipc()
|
2025-08-14 14:16:17 +02:00
|
|
|
|
|
|
|
|
err := ipc.Connect()
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Fatal(err)
|
|
|
|
|
}
|
2025-08-15 12:16:08 +02:00
|
|
|
defer ipc.Close()
|
2025-08-14 14:16:17 +02:00
|
|
|
|
2025-08-14 22:59:38 +02:00
|
|
|
version, err := ipc.GetVersion()
|
2025-08-14 14:16:17 +02:00
|
|
|
if err != nil {
|
|
|
|
|
log.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-14 22:59:38 +02:00
|
|
|
repr.Println(version)
|
2025-08-14 14:16:17 +02:00
|
|
|
}
|