aboutsummaryrefslogtreecommitdiff
path: root/nexgb/examples/atom.go
blob: 2cb71320db7a66069fcfe122f712c5e8a3ed43e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main

import (
	// "fmt" 
	"log"

	"github.com/BurntSushi/xgb"
)

func init() {
	log.SetFlags(0)
}

func main() {
	X, err := xgb.NewConn()
	if err != nil {
		log.Fatal(err)
	}

	aname := "_NET_ACTIVE_WINDOW"
	atom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply()
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("%d", atom.Atom)
}