aboutsummaryrefslogtreecommitdiff
path: root/nexgb/examples/xinerama.go
diff options
context:
space:
mode:
Diffstat (limited to 'nexgb/examples/xinerama.go')
-rw-r--r--nexgb/examples/xinerama.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/nexgb/examples/xinerama.go b/nexgb/examples/xinerama.go
new file mode 100644
index 0000000..7fe9984
--- /dev/null
+++ b/nexgb/examples/xinerama.go
@@ -0,0 +1,29 @@
+package main
+
+import (
+ "fmt"
+ "log"
+
+ "github.com/BurntSushi/xgb"
+)
+
+func main() {
+ X, _ := xgb.NewConn()
+
+ err := X.RegisterExtension("xinerama")
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ reply, err := X.XineramaQueryScreens().Reply()
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ fmt.Printf("Xinerama number: %d\n", reply.Number)
+ for i, screen := range reply.ScreenInfo {
+ fmt.Printf("%d :: X: %d, Y: %d, Width: %d, Height: %d\n",
+ i, screen.XOrg, screen.YOrg, screen.Width, screen.Height)
+ }
+}
+