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 403 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/dominikh/xcapture
  192. github.com/droundy/xgbutil/ewmh
  193. github.com/droundy/xgbutil/icccm
  194. github.com/droundy/xgbutil/keybind
  195. github.com/droundy/xgbutil/motif
  196. github.com/droundy/xgbutil/mousebind
  197. github.com/droundy/xgbutil/tests
  198. github.com/droundy/xgbutil/xcursor
  199. github.com/droundy/xgbutil/xevent
  200. github.com/droundy/xgbutil/xgraphics
  201. github.com/droundy/xgbutil/xinerama
  202. github.com/droundy/xgbutil/xprop
  203. github.com/droundy/xgbutil/xwindow
  204. github.com/errnoh/go.wde/xgb
  205. github.com/extemporalgenome/xrs
  206. github.com/fangyuanziti/wayland-html
  207. github.com/fangyuanziti/xgbutil/ewmh
  208. github.com/fangyuanziti/xgbutil/icccm
  209. github.com/fangyuanziti/xgbutil/keybind
  210. github.com/fangyuanziti/xgbutil/motif
  211. github.com/fangyuanziti/xgbutil/mousebind
  212. github.com/fangyuanziti/xgbutil/xcursor
  213. github.com/fangyuanziti/xgbutil/xevent
  214. github.com/fangyuanziti/xgbutil/xgraphics
  215. github.com/fangyuanziti/xgbutil/xinerama
  216. github.com/fangyuanziti/xgbutil/xprop
  217. github.com/fangyuanziti/xgbutil/xwindow
  218. github.com/floren/wingo
  219. github.com/floren/wingo/cursors
  220. github.com/floren/wingo/focus
  221. github.com/floren/wingo/frame
  222. github.com/floren/wingo/heads
  223. github.com/floren/wingo/prompt
  224. github.com/floren/wingo/render
  225. github.com/floren/wingo/stack
  226. github.com/floren/wingo/text
  227. github.com/floren/wingo/wm
  228. github.com/floren/wingo/workspace
  229. github.com/floren/wingo/xclient
  230. github.com/gen2brain/goiv
  231. github.com/go-ui/ui/drivers/x11
  232. github.com/grd/go.wde/xgb
  233. github.com/guelfey/go.wde/xgb
  234. github.com/henkman/go.wde/xgb
  235. github.com/heydabop/go2048
  236. github.com/hobeone/keysocket-server
  237. github.com/hotei/bmp/bmpic
  238. github.com/hotei/rsb/examples/showRSB
  239. github.com/iand/go.wde/xgb
  240. github.com/istdev/x11ui
  241. github.com/istdev/x11ui/samples/slider
  242. github.com/jbaikge/application-tracker
  243. github.com/jeromenerf/hotkeys
  244. github.com/jouyouyun/XRecordGrab
  245. github.com/justjake/j3
  246. github.com/justjake/j3/ui
  247. github.com/justjake/j3/wm
  248. github.com/kalkin/wingo
  249. github.com/kalkin/wingo/cursors
  250. github.com/kalkin/wingo/event
  251. github.com/kalkin/wingo/focus
  252. github.com/kalkin/wingo/frame
  253. github.com/kalkin/wingo/heads
  254. github.com/kalkin/wingo/prompt
  255. github.com/kalkin/wingo/render
  256. github.com/kalkin/wingo/stack
  257. github.com/kalkin/wingo/text
  258. github.com/kalkin/wingo/wm
  259. github.com/kalkin/wingo/workspace
  260. github.com/kalkin/wingo/xclient
  261. github.com/kirillDanshin/go-wde/xgb
  262. github.com/lex148/LightRead
  263. github.com/lex148/xgbutil/ewmh
  264. github.com/lex148/xgbutil/icccm
  265. github.com/lex148/xgbutil/keybind
  266. github.com/lex148/xgbutil/motif
  267. github.com/lex148/xgbutil/mousebind
  268. github.com/lex148/xgbutil/xcursor
  269. github.com/lex148/xgbutil/xevent
  270. github.com/lex148/xgbutil/xgraphics
  271. github.com/lex148/xgbutil/xinerama
  272. github.com/lex148/xgbutil/xprop
  273. github.com/lex148/xgbutil/xwindow
  274. github.com/linuxdeepin/dde-api/mousearea
  275. github.com/linuxdeepin/dde-daemon/dock
  276. github.com/linuxdeepin/dde-daemon/grub2
  277. github.com/linuxdeepin/dde-daemon/keybinding
  278. github.com/linuxdeepin/dde-daemon/keybinding/core
  279. github.com/linuxdeepin/dde-daemon/screenedge
  280. github.com/linuxdeepin/dde-daemon/screensaver
  281. github.com/linuxdeepin/dde-daemon/session/power
  282. github.com/linuxdeepin/dde-daemon/trayicon
  283. github.com/linuxdeepin/dde-daemon/x_event_monitor
  284. github.com/linuxdeepin/go-lib/appinfo
  285. github.com/linuxdeepin/startdde
  286. github.com/linuxdeepin/startdde/swapsched
  287. github.com/linuxdeepin/startdde/wm
  288. github.com/linuxdeepin/startdde/xsettings
  289. github.com/llgcode/go.wde/xgb
  290. github.com/mibitzi/stwm/keybind
  291. github.com/mibitzi/stwm/xclient
  292. github.com/mibitzi/stwm/xgb
  293. github.com/mistree/go.wde/xgb
  294. github.com/mpnordland/mirror-go
  295. github.com/nickoneill/go.wde/xgb
  296. github.com/oakmound/shiny/driver/internal/x11
  297. github.com/oakmound/shiny/driver/x11driver
  298. github.com/oblitum/backlight
  299. github.com/onodera-punpun/sponewm
  300. github.com/onodera-punpun/sponewm/cursors
  301. github.com/onodera-punpun/sponewm/event
  302. github.com/onodera-punpun/sponewm/focus
  303. github.com/onodera-punpun/sponewm/frame
  304. github.com/onodera-punpun/sponewm/heads
  305. github.com/onodera-punpun/sponewm/layout
  306. github.com/onodera-punpun/sponewm/stack
  307. github.com/onodera-punpun/sponewm/wm
  308. github.com/onodera-punpun/sponewm/workspace
  309. github.com/onodera-punpun/sponewm/xclient
  310. github.com/papplampe/go.wde/xgb
  311. github.com/pascience/foci
  312. github.com/pascience/foci/cursors
  313. github.com/pascience/foci/event
  314. github.com/pascience/foci/focus
  315. github.com/pascience/foci/frame
  316. github.com/pascience/foci/heads
  317. github.com/pascience/foci/prompt
  318. github.com/pascience/foci/render
  319. github.com/pascience/foci/stack
  320. github.com/pascience/foci/text
  321. github.com/pascience/foci/wm
  322. github.com/pascience/foci/workspace
  323. github.com/pascience/foci/xclient
  324. github.com/pascience/wingo/cursors
  325. github.com/pascience/wingo/event
  326. github.com/pascience/wingo/focus
  327. github.com/pascience/wingo/frame
  328. github.com/pascience/wingo/heads
  329. github.com/pascience/wingo/prompt
  330. github.com/pascience/wingo/render
  331. github.com/pascience/wingo/stack
  332. github.com/pascience/wingo/text
  333. github.com/pascience/wingo/wm
  334. github.com/pascience/wingo/workspace
  335. github.com/pascience/wingo/xclient
  336. github.com/pointlander/csm
  337. github.com/proxypoke/chiwa/util
  338. github.com/proxypoke/chiwa/wallpaper
  339. github.com/remogatto/egles/examples/es2/xorg
  340. github.com/reusee/yokan
  341. github.com/ricochet2200/go.wde/xgb
  342. github.com/sebastianskejoe/go.wde/xgb
  343. github.com/siebenmann/ffox-remote
  344. github.com/sinni800/go.wde/xgb
  345. github.com/skelterjohn/go.wde/xgb
  346. github.com/sqweek/go.wde/xgb
  347. github.com/stanim/display
  348. github.com/stanim/generals/example
  349. github.com/stanim/vgximg
  350. github.com/taruti/go.wde/xgb
  351. github.com/thenonameguy/emptybox
  352. github.com/thesyncim/go.wde/xgb
  353. github.com/tsavola/ditor/ui
  354. github.com/tv42/quobar
  355. github.com/tv42/x11-media-keys
  356. github.com/tvdburgt/passman/clipboard
  357. github.com/uriel/vimg
  358. github.com/varialus/gobar
  359. github.com/varialus/gobar/commandtray
  360. github.com/varialus/gobar/gen-bar-config
  361. github.com/varialus/gobar/statbar
  362. github.com/varialus/wingo
  363. github.com/varialus/wingo/cursors
  364. github.com/varialus/wingo/event
  365. github.com/varialus/wingo/focus
  366. github.com/varialus/wingo/frame
  367. github.com/varialus/wingo/heads
  368. github.com/varialus/wingo/prompt
  369. github.com/varialus/wingo/render
  370. github.com/varialus/wingo/stack
  371. github.com/varialus/wingo/text
  372. github.com/varialus/wingo/wm
  373. github.com/varialus/wingo/workspace
  374. github.com/varialus/wingo/xclient
  375. github.com/whyrusleeping/go.wde/xgb
  376. github.com/wiless/x11ui
  377. github.com/wiless/x11ui/samples/slider
  378. github.com/willemvds/Hopp-polla/eventserver
  379. github.com/xsrc/wingo/cursors
  380. github.com/xsrc/wingo/event
  381. github.com/xsrc/wingo/focus
  382. github.com/xsrc/wingo/frame
  383. github.com/xsrc/wingo/heads
  384. github.com/xsrc/wingo/prompt
  385. github.com/xsrc/wingo/render
  386. github.com/xsrc/wingo/stack
  387. github.com/xsrc/wingo/text
  388. github.com/xsrc/wingo/wm
  389. github.com/xsrc/wingo/workspace
  390. github.com/xsrc/wingo/xclient
  391. github.com/xthexder/superhexagon
  392. github.com/yannicklm/wingo
  393. github.com/yannicklm/wingo/cursors
  394. github.com/yannicklm/wingo/focus
  395. github.com/yannicklm/wingo/frame
  396. github.com/yannicklm/wingo/heads
  397. github.com/yannicklm/wingo/prompt
  398. github.com/yannicklm/wingo/render
  399. github.com/yannicklm/wingo/stack
  400. github.com/yannicklm/wingo/text
  401. github.com/yannicklm/wingo/wm
  402. github.com/yannicklm/wingo/workspace
  403. 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