top

Package xgbutil is a utility library designed to make common tasks with the X server easier. The central design choice that has driven development is to hide the complexity of X wherever possible but expose it when necessary.

For example, the xevent package provides an implementation of an X event loop that acts as a dispatcher to event handlers set up with the xevent, keybind and mousebind packages. At the same time, the event queue is exposed and can be modified using xevent.Peek and xevent.DequeueAt.

Sub-packages

The xgbutil package is considerably small, and only contains some type definitions and the initial setup for an X connection. Much of the functionality of xgbutil comes from its sub-packages. Each sub-package is appropriately documented.

Installation

xgbutil is go-gettable:

go get github.com/BurntSushi/xgbutil

Dependencies

XGB is the main dependency, and is required for all packages inside xgbutil.

graphics-go and freetype-go are also required if using the xgraphics package.

Quick Example

A quick example to demonstrate that xgbutil is working correctly:

go get github.com/BurntSushi/xgbutil/examples/window-name-sizes
GO/PATH/bin/window-name-sizes

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.)

Examples

The examples directory contains a sizable number of examples demonstrating common tasks with X. They are intended to demonstrate a single thing each, although a few that require setup are necessarily long. Each example is heavily documented.

The examples directory should be your first stop when learning how to use xgbutil.

xgbutil is also used heavily throughout my window manager, Wingo. It may be useful reference material.

Wingo project page: https://github.com/BurntSushi/wingo

Thread Safety

While I am fairly confident that XGB is thread safe, I am only somewhat confident that xgbutil is thread safe. It simply has not been tested enough for my confidence to be higher.

Note that the xevent package's X event loop is not concurrent. Namely, designing a generally concurrent X event loop is extremely complex. Instead, the onus is on you, the user, to design concurrent callback functions if concurrency is desired.

Imported by 392 package(s)

  1. code.google.com/p/ncabatoff/vlib
  2. dasa.cc/run/prompt
  3. github.com/AmandaCameron/go.wde/xgb
  4. github.com/AmandaCameron/gobar
  5. github.com/AmandaCameron/gobar/commandtray
  6. github.com/AmandaCameron/gobar/gen-bar-config
  7. github.com/AmandaCameron/gobar/statbar
  8. github.com/AmandaCameron/gobar/utils/startup
  9. github.com/AmandaCameron/gobar/utils/system-tray
  10. github.com/AmandaCameron/gobar/utils/system-tray/tests
  11. github.com/AmandaCameron/gobar/utils/xembed
  12. github.com/AmandaCameron/gobar/utils/xsettings
  13. github.com/AmandaCameron/wingo
  14. github.com/AmandaCameron/wingo/cursors
  15. github.com/AmandaCameron/wingo/event
  16. github.com/AmandaCameron/wingo/focus
  17. github.com/AmandaCameron/wingo/frame
  18. github.com/AmandaCameron/wingo/heads
  19. github.com/AmandaCameron/wingo/prompt
  20. github.com/AmandaCameron/wingo/render
  21. github.com/AmandaCameron/wingo/stack
  22. github.com/AmandaCameron/wingo/text
  23. github.com/AmandaCameron/wingo/wm
  24. github.com/AmandaCameron/wingo/workspace
  25. github.com/AmandaCameron/wingo/xclient
  26. github.com/Arrow/display
  27. github.com/Arrow/generals/example
  28. github.com/Arrow/vgximg
  29. github.com/BlueDragonX/keysocket-server
  30. github.com/BurntSushi/imgv
  31. github.com/BurntSushi/wingo
  32. github.com/BurntSushi/wingo/cursors
  33. github.com/BurntSushi/wingo/event
  34. github.com/BurntSushi/wingo/focus
  35. github.com/BurntSushi/wingo/frame
  36. github.com/BurntSushi/wingo/heads
  37. github.com/BurntSushi/wingo/prompt
  38. github.com/BurntSushi/wingo/prompt/examples/cycle
  39. github.com/BurntSushi/wingo/prompt/examples/input
  40. github.com/BurntSushi/wingo/prompt/examples/message
  41. github.com/BurntSushi/wingo/prompt/examples/select
  42. github.com/BurntSushi/wingo/render
  43. github.com/BurntSushi/wingo/stack
  44. github.com/BurntSushi/wingo/text
  45. github.com/BurntSushi/wingo/text/examples/input
  46. github.com/BurntSushi/wingo/wm
  47. github.com/BurntSushi/wingo/workspace
  48. github.com/BurntSushi/wingo/xclient
  49. github.com/BurntSushi/xgbutil/ewmh
  50. github.com/BurntSushi/xgbutil/icccm
  51. github.com/BurntSushi/xgbutil/keybind
  52. github.com/BurntSushi/xgbutil/motif
  53. github.com/BurntSushi/xgbutil/mousebind
  54. github.com/BurntSushi/xgbutil/xcursor
  55. github.com/BurntSushi/xgbutil/xevent
  56. github.com/BurntSushi/xgbutil/xgraphics
  57. github.com/BurntSushi/xgbutil/xinerama
  58. github.com/BurntSushi/xgbutil/xprop
  59. github.com/BurntSushi/xgbutil/xwindow
  60. github.com/FredFoonly/gobar
  61. github.com/FredFoonly/wingo
  62. github.com/FredFoonly/wingo/cursors
  63. github.com/FredFoonly/wingo/event
  64. github.com/FredFoonly/wingo/focus
  65. github.com/FredFoonly/wingo/frame
  66. github.com/FredFoonly/wingo/heads
  67. github.com/FredFoonly/wingo/prompt
  68. github.com/FredFoonly/wingo/render
  69. github.com/FredFoonly/wingo/stack
  70. github.com/FredFoonly/wingo/text
  71. github.com/FredFoonly/wingo/wm
  72. github.com/FredFoonly/wingo/workspace
  73. github.com/FredFoonly/wingo/xclient
  74. github.com/Iceyer/dde-daemon/dock
  75. github.com/Iceyer/dde-daemon/grub2
  76. github.com/Iceyer/dde-daemon/keybinding
  77. github.com/Iceyer/dde-daemon/power
  78. github.com/Iceyer/dde-daemon/screen_edges
  79. github.com/Iceyer/dde-daemon/screensaver
  80. github.com/Jackneill/slwm
  81. github.com/JonathanLogan/xgbutil/ewmh
  82. github.com/JonathanLogan/xgbutil/icccm
  83. github.com/JonathanLogan/xgbutil/keybind
  84. github.com/JonathanLogan/xgbutil/motif
  85. github.com/JonathanLogan/xgbutil/mousebind
  86. github.com/JonathanLogan/xgbutil/xcursor
  87. github.com/JonathanLogan/xgbutil/xevent
  88. github.com/JonathanLogan/xgbutil/xgraphics
  89. github.com/JonathanLogan/xgbutil/xinerama
  90. github.com/JonathanLogan/xgbutil/xprop
  91. github.com/JonathanLogan/xgbutil/xwindow
  92. github.com/KaptajnKold/antwar
  93. github.com/KarateCode/go.wde/xgb
  94. github.com/KenjiTakahashi/gobar
  95. github.com/ManofJELLO/Custard
  96. github.com/Pitmairen/tpswipe
  97. github.com/Pursuit92/wingo
  98. github.com/Pursuit92/wingo/cursors
  99. github.com/Pursuit92/wingo/focus
  100. github.com/Pursuit92/wingo/frame
  101. github.com/Pursuit92/wingo/heads
  102. github.com/Pursuit92/wingo/prompt
  103. github.com/Pursuit92/wingo/render
  104. github.com/Pursuit92/wingo/stack
  105. github.com/Pursuit92/wingo/text
  106. github.com/Pursuit92/wingo/wm
  107. github.com/Pursuit92/wingo/workspace
  108. github.com/Pursuit92/wingo/xclient
  109. github.com/Zwobot/go.wde/xgb
  110. github.com/a1305315624/go.wde/xgb
  111. github.com/aarzilli/xgbutil/ewmh
  112. github.com/aarzilli/xgbutil/icccm
  113. github.com/aarzilli/xgbutil/keybind
  114. github.com/aarzilli/xgbutil/motif
  115. github.com/aarzilli/xgbutil/mousebind
  116. github.com/aarzilli/xgbutil/xcursor
  117. github.com/aarzilli/xgbutil/xevent
  118. github.com/aarzilli/xgbutil/xgraphics
  119. github.com/aarzilli/xgbutil/xinerama
  120. github.com/aarzilli/xgbutil/xprop
  121. github.com/aarzilli/xgbutil/xwindow
  122. github.com/addtheice/DataVisual
  123. github.com/alexanderkyte/wingo
  124. github.com/alexanderkyte/wingo/cursors
  125. github.com/alexanderkyte/wingo/event
  126. github.com/alexanderkyte/wingo/focus
  127. github.com/alexanderkyte/wingo/frame
  128. github.com/alexanderkyte/wingo/heads
  129. github.com/alexanderkyte/wingo/prompt
  130. github.com/alexanderkyte/wingo/render
  131. github.com/alexanderkyte/wingo/stack
  132. github.com/alexanderkyte/wingo/text
  133. github.com/alexanderkyte/wingo/wm
  134. github.com/alexanderkyte/wingo/workspace
  135. github.com/alexanderkyte/wingo/xclient
  136. github.com/andrebq/go.wde/xgb
  137. github.com/auroralaboratories/corona-api/modules/session
  138. github.com/auroralaboratories/corona-ui
  139. github.com/averrin/shadow-go
  140. github.com/bmatsuo/dockapp-go/dockapp
  141. github.com/boomshroom/go.wde/xgb
  142. github.com/cabrel/xfcm
  143. github.com/cajun/LightRead
  144. github.com/cespare/carlisle
  145. github.com/cnitfarmer/go.wde/xgb
  146. github.com/codechapin/go.wde/xgb
  147. github.com/cookieo9/go.wde/xgb
  148. github.com/cshapeshifter/wingo
  149. github.com/cshapeshifter/wingo/cursors
  150. github.com/cshapeshifter/wingo/focus
  151. github.com/cshapeshifter/wingo/frame
  152. github.com/cshapeshifter/wingo/heads
  153. github.com/cshapeshifter/wingo/prompt
  154. github.com/cshapeshifter/wingo/render
  155. github.com/cshapeshifter/wingo/stack
  156. github.com/cshapeshifter/wingo/text
  157. github.com/cshapeshifter/wingo/wm
  158. github.com/cshapeshifter/wingo/workspace
  159. github.com/cshapeshifter/wingo/xclient
  160. github.com/ctlod/go.wde/xgb
  161. github.com/darthlukan/go.wde/xgb
  162. github.com/darthlukan/gopanel
  163. github.com/darthlukan/wingo-menu
  164. github.com/dim13/wingo
  165. github.com/dim13/wingo/cursors
  166. github.com/dim13/wingo/event
  167. github.com/dim13/wingo/focus
  168. github.com/dim13/wingo/frame
  169. github.com/dim13/wingo/heads
  170. github.com/dim13/wingo/prompt
  171. github.com/dim13/wingo/render
  172. github.com/dim13/wingo/stack
  173. github.com/dim13/wingo/text
  174. github.com/dim13/wingo/wm
  175. github.com/dim13/wingo/workspace
  176. github.com/dim13/wingo/xclient
  177. github.com/distatus/gobar
  178. github.com/dkua/bmp/bmpic
  179. github.com/dlintw/wingo
  180. github.com/dlintw/wingo/cmdusage
  181. github.com/dlintw/wingo/cursors
  182. github.com/dlintw/wingo/focus
  183. github.com/dlintw/wingo/frame
  184. github.com/dlintw/wingo/heads
  185. github.com/dlintw/wingo/prompt
  186. github.com/dlintw/wingo/render
  187. github.com/dlintw/wingo/stack
  188. github.com/dlintw/wingo/text
  189. github.com/dlintw/wingo/wingo-cmd
  190. github.com/dlintw/wingo/workspace
  191. github.com/droundy/xgbutil/ewmh
  192. github.com/droundy/xgbutil/icccm
  193. github.com/droundy/xgbutil/keybind
  194. github.com/droundy/xgbutil/motif
  195. github.com/droundy/xgbutil/mousebind
  196. github.com/droundy/xgbutil/tests
  197. github.com/droundy/xgbutil/xcursor
  198. github.com/droundy/xgbutil/xevent
  199. github.com/droundy/xgbutil/xgraphics
  200. github.com/droundy/xgbutil/xinerama
  201. github.com/droundy/xgbutil/xprop
  202. github.com/droundy/xgbutil/xwindow
  203. github.com/errnoh/go.wde/xgb
  204. github.com/extemporalgenome/xrs
  205. github.com/fangyuanziti/wayland-html
  206. github.com/fangyuanziti/xgbutil/ewmh
  207. github.com/fangyuanziti/xgbutil/icccm
  208. github.com/fangyuanziti/xgbutil/keybind
  209. github.com/fangyuanziti/xgbutil/motif
  210. github.com/fangyuanziti/xgbutil/mousebind
  211. github.com/fangyuanziti/xgbutil/xcursor
  212. github.com/fangyuanziti/xgbutil/xevent
  213. github.com/fangyuanziti/xgbutil/xgraphics
  214. github.com/fangyuanziti/xgbutil/xinerama
  215. github.com/fangyuanziti/xgbutil/xprop
  216. github.com/fangyuanziti/xgbutil/xwindow
  217. github.com/floren/wingo
  218. github.com/floren/wingo/cursors
  219. github.com/floren/wingo/focus
  220. github.com/floren/wingo/frame
  221. github.com/floren/wingo/heads
  222. github.com/floren/wingo/prompt
  223. github.com/floren/wingo/render
  224. github.com/floren/wingo/stack
  225. github.com/floren/wingo/text
  226. github.com/floren/wingo/wm
  227. github.com/floren/wingo/workspace
  228. github.com/floren/wingo/xclient
  229. github.com/grd/go.wde/xgb
  230. github.com/guelfey/go.wde/xgb
  231. github.com/henkman/go.wde/xgb
  232. github.com/heydabop/go2048
  233. github.com/hobeone/keysocket-server
  234. github.com/hotei/bmp/bmpic
  235. github.com/hotei/rsb/examples/showRSB
  236. github.com/iand/go.wde/xgb
  237. github.com/istdev/x11ui
  238. github.com/istdev/x11ui/samples/slider
  239. github.com/jbaikge/application-tracker
  240. github.com/jeromenerf/hotkeys
  241. github.com/jouyouyun/XRecordGrab
  242. github.com/justjake/j3
  243. github.com/justjake/j3/ui
  244. github.com/justjake/j3/wm
  245. github.com/kalkin/wingo
  246. github.com/kalkin/wingo/cursors
  247. github.com/kalkin/wingo/event
  248. github.com/kalkin/wingo/focus
  249. github.com/kalkin/wingo/frame
  250. github.com/kalkin/wingo/heads
  251. github.com/kalkin/wingo/prompt
  252. github.com/kalkin/wingo/render
  253. github.com/kalkin/wingo/stack
  254. github.com/kalkin/wingo/text
  255. github.com/kalkin/wingo/wm
  256. github.com/kalkin/wingo/workspace
  257. github.com/kalkin/wingo/xclient
  258. github.com/kirillDanshin/go-wde/xgb
  259. github.com/lex148/LightRead
  260. github.com/lex148/xgbutil/ewmh
  261. github.com/lex148/xgbutil/icccm
  262. github.com/lex148/xgbutil/keybind
  263. github.com/lex148/xgbutil/motif
  264. github.com/lex148/xgbutil/mousebind
  265. github.com/lex148/xgbutil/xcursor
  266. github.com/lex148/xgbutil/xevent
  267. github.com/lex148/xgbutil/xgraphics
  268. github.com/lex148/xgbutil/xinerama
  269. github.com/lex148/xgbutil/xprop
  270. github.com/lex148/xgbutil/xwindow
  271. github.com/linuxdeepin/dde-api/mousearea
  272. github.com/linuxdeepin/dde-daemon/dock
  273. github.com/linuxdeepin/dde-daemon/grub2
  274. github.com/linuxdeepin/dde-daemon/keybinding
  275. github.com/linuxdeepin/dde-daemon/keybinding/core
  276. github.com/linuxdeepin/dde-daemon/screenedge
  277. github.com/linuxdeepin/dde-daemon/screensaver
  278. github.com/linuxdeepin/dde-daemon/session/power
  279. github.com/linuxdeepin/dde-daemon/trayicon
  280. github.com/llgcode/go.wde/xgb
  281. github.com/mibitzi/stwm/keybind
  282. github.com/mibitzi/stwm/xclient
  283. github.com/mibitzi/stwm/xgb
  284. github.com/mistree/go.wde/xgb
  285. github.com/mpnordland/mirror-go
  286. github.com/nickoneill/go.wde/xgb
  287. github.com/oblitum/backlight
  288. github.com/onodera-punpun/sponewm
  289. github.com/onodera-punpun/sponewm/cursors
  290. github.com/onodera-punpun/sponewm/event
  291. github.com/onodera-punpun/sponewm/focus
  292. github.com/onodera-punpun/sponewm/frame
  293. github.com/onodera-punpun/sponewm/heads
  294. github.com/onodera-punpun/sponewm/layout
  295. github.com/onodera-punpun/sponewm/stack
  296. github.com/onodera-punpun/sponewm/wm
  297. github.com/onodera-punpun/sponewm/workspace
  298. github.com/onodera-punpun/sponewm/xclient
  299. github.com/papplampe/go.wde/xgb
  300. github.com/pascience/foci
  301. github.com/pascience/foci/cursors
  302. github.com/pascience/foci/event
  303. github.com/pascience/foci/focus
  304. github.com/pascience/foci/frame
  305. github.com/pascience/foci/heads
  306. github.com/pascience/foci/prompt
  307. github.com/pascience/foci/render
  308. github.com/pascience/foci/stack
  309. github.com/pascience/foci/text
  310. github.com/pascience/foci/wm
  311. github.com/pascience/foci/workspace
  312. github.com/pascience/foci/xclient
  313. github.com/pascience/wingo/cursors
  314. github.com/pascience/wingo/event
  315. github.com/pascience/wingo/focus
  316. github.com/pascience/wingo/frame
  317. github.com/pascience/wingo/heads
  318. github.com/pascience/wingo/prompt
  319. github.com/pascience/wingo/render
  320. github.com/pascience/wingo/stack
  321. github.com/pascience/wingo/text
  322. github.com/pascience/wingo/wm
  323. github.com/pascience/wingo/workspace
  324. github.com/pascience/wingo/xclient
  325. github.com/pointlander/csm
  326. github.com/proxypoke/chiwa/util
  327. github.com/proxypoke/chiwa/wallpaper
  328. github.com/remogatto/egles/examples/es2/xorg
  329. github.com/reusee/yokan
  330. github.com/ricochet2200/go.wde/xgb
  331. github.com/sebastianskejoe/go.wde/xgb
  332. github.com/siebenmann/ffox-remote
  333. github.com/sinni800/go.wde/xgb
  334. github.com/skelterjohn/go.wde/xgb
  335. github.com/sqweek/go.wde/xgb
  336. github.com/stanim/display
  337. github.com/stanim/generals/example
  338. github.com/stanim/vgximg
  339. github.com/taruti/go.wde/xgb
  340. github.com/thenonameguy/emptybox
  341. github.com/thesyncim/go.wde/xgb
  342. github.com/tsavola/ditor/ui
  343. github.com/tv42/quobar
  344. github.com/tv42/x11-media-keys
  345. github.com/tvdburgt/passman/clipboard
  346. github.com/uriel/vimg
  347. github.com/varialus/gobar
  348. github.com/varialus/gobar/commandtray
  349. github.com/varialus/gobar/gen-bar-config
  350. github.com/varialus/gobar/statbar
  351. github.com/varialus/wingo
  352. github.com/varialus/wingo/cursors
  353. github.com/varialus/wingo/event
  354. github.com/varialus/wingo/focus
  355. github.com/varialus/wingo/frame
  356. github.com/varialus/wingo/heads
  357. github.com/varialus/wingo/prompt
  358. github.com/varialus/wingo/render
  359. github.com/varialus/wingo/stack
  360. github.com/varialus/wingo/text
  361. github.com/varialus/wingo/wm
  362. github.com/varialus/wingo/workspace
  363. github.com/varialus/wingo/xclient
  364. github.com/whyrusleeping/go.wde/xgb
  365. github.com/wiless/x11ui
  366. github.com/wiless/x11ui/samples/slider
  367. github.com/willemvds/Hopp-polla/eventserver
  368. github.com/xsrc/wingo/cursors
  369. github.com/xsrc/wingo/event
  370. github.com/xsrc/wingo/focus
  371. github.com/xsrc/wingo/frame
  372. github.com/xsrc/wingo/heads
  373. github.com/xsrc/wingo/prompt
  374. github.com/xsrc/wingo/render
  375. github.com/xsrc/wingo/stack
  376. github.com/xsrc/wingo/text
  377. github.com/xsrc/wingo/wm
  378. github.com/xsrc/wingo/workspace
  379. github.com/xsrc/wingo/xclient
  380. github.com/xthexder/superhexagon
  381. github.com/yannicklm/wingo
  382. github.com/yannicklm/wingo/cursors
  383. github.com/yannicklm/wingo/focus
  384. github.com/yannicklm/wingo/frame
  385. github.com/yannicklm/wingo/heads
  386. github.com/yannicklm/wingo/prompt
  387. github.com/yannicklm/wingo/render
  388. github.com/yannicklm/wingo/stack
  389. github.com/yannicklm/wingo/text
  390. github.com/yannicklm/wingo/wm
  391. github.com/yannicklm/wingo/workspace
  392. github.com/yannicklm/wingo/xclient

Imports 3 package(s)

  1. github.com/BurntSushi/xgb
  2. github.com/BurntSushi/xgb/xproto
  3. github.com/BurntSushi/xgb/xinerama