mirror of
https://codeberg.org/scip/swayipc.git
synced 2025-12-16 12:10:57 +01:00
implemented more stuff along with samples
This commit is contained in:
28
_examples/get_outputs/main.go
Normal file
28
_examples/get_outputs/main.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
/*
|
||||
Retrieve a list of current available outputs
|
||||
*/
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/alecthomas/repr"
|
||||
"github.com/tlinden/i3ipc"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ipc := i3ipc.NewI3ipc()
|
||||
|
||||
err := ipc.Connect()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
outputs, err := ipc.GetOutputs()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
repr.Println(outputs)
|
||||
}
|
||||
Reference in New Issue
Block a user