Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A utility library to make use of the X Go Binding easier. (Implements EWMH and ICCCM specs, key binding support, etc.)
Go Other
Latest commit a9d4473 @BurntSushi Merge pull request #31 from aarzilli/master
Improved performance of XPaintRects
Failed to load latest commit information.
_examples 80 cols
ewmh gofmt
gopher Docs for gopher.
icccm gofmt
keybind Close #17.
motif gofmt
mousebind @dominikh is keeping me honest.
scripts Add the Shape extension's NotifyEvent to the event system.
xcursor gofmt
xevent Close #16. Bring doco for MainPing up to date.
xgraphics Improved performance of XPaintRects by copying subimages one whole ro…
xinerama gofmt
xrect gofmt
xwindow Always ignore border width changes.
.gitignore ignore vim tag file
Makefile Lazy.
README Fix quick example instructions
STYLE Add style guidelines.
doc.go gofmt
session.vim more convenient name
types.go gofmt
xgbutil.go add new api: NewConnXgb


xgbutil is a utility library designed to work with the X Go Binding. This 
project's main goal is to make various X related tasks easier. For example, 
binding keys, using the EWMH or ICCCM specs with the window manager, 
moving/resizing windows, assigning function callbacks to particular events,
drawing images to a window, etc.

xgbutil attempts to be thread safe, but it has not been completely tested in 
this regard. In general, the X event loop implemented in the xevent package is 
sequential. The idea is to be sequential by default, and let the user spawn 
concurrent code at their discretion. (i.e., the complexity of making the main 
event loop generally concurrent is vast.)

You may sleep safely at night by assuming that XGB is thread safe, though.

To start using xgbutil, you should have at least a passing familiarity with X. 
Your first stop should be the examples directory.

go get

XGB is the main dependency. Use of the xgraphics packages requires graphics-go
and freetype-go.

XGB project URL:

Quick Example
go get

The output will be a list of names of all top-level windows and their geometry 
including window manager decorations. (Assuming your window manager supports 
some basic EWMH properties.)

gopkgdoc is well-suited to provide documentation for xgbutil. Its cross-package 
hyperlinking on types is also extremely useful, since much of xgbutil relies on 

With that said, documentation is also hosted here:

There are several examples in the examples directory covering common use cases. 
They are heavily documented and should run out of the box.

An older project of mine, xpybutil, served as inspiration for xgbutil. If you 
want to use Python, xpybutil should help quite a bit. Please note though, that 
at this point, xgbutil provides a lot more functionality and is much better 

xpybutil project URL:

Something went wrong with that request. Please try again.