mirror of
https://codeberg.org/scip/swayipc.git
synced 2025-12-16 12:10:57 +01:00
30 lines
373 B
Go
30 lines
373 B
Go
package main
|
|
|
|
/*
|
|
Retrieve a list of current available workspaces
|
|
*/
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/alecthomas/repr"
|
|
"github.com/tlinden/i3ipc"
|
|
)
|
|
|
|
func main() {
|
|
ipc := i3ipc.NewI3ipc()
|
|
|
|
err := ipc.Connect()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
defer ipc.Close()
|
|
|
|
workspaces, err := ipc.GetWorkspaces()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
repr.Println(workspaces)
|
|
}
|