Skip to main content

Extensions

Most interesting X functionality lives in protocol extensions. node-x11 loads them at runtime with X.require(name, callback). The callback receives an extension object carrying the extension's requests, enums and version info; any extension events are registered on the client automatically:

X.require('randr', (err, Randr) => {
if (err) throw err; // extension missing on this server
Randr.GetScreenResources(display.screen[0].root, (err, res) => {
console.log(res.outputs);
});
});

name is the module name below (the file in lib/ext/), not the on-the-wire extension name. Requiring an extension twice returns the cached instance.

Available extensions

moduleX namewhat it does
apple-wmApple-WMXQuartz window-manager integration
big-requestsBIG-REQUESTSrequests larger than 256 KiB (enabled automatically at connect)
compositeCompositeredirect window rendering off-screen
damageDAMAGEbe notified when drawables change
dbeDOUBLE-BUFFERflicker-free double buffering
dpmsDPMSmonitor power management
fixesXFIXESregions, cursor names, selection tracking
geGeneric Event Extensionframing for extensions with large events
glxGLXOpenGL rendering over the X protocol
presentPresentvsynced pixmap presentation
randrRANDRoutputs, CRTCs, modes, rotation
recordRECORDrecord/replay of the protocol stream
renderRENDERanti-aliased compositing, gradients, glyphs
resX-Resourceper-client server resource usage
screen-saverMIT-SCREEN-SAVERscreen-saver control and notification
shapeSHAPEnon-rectangular windows
shmMIT-SHMshared-memory images
syncSYNCcounters, alarms, fences
xc-miscXC-MISCXID range recycling
xineramaXINERAMAmulti-head screen layout
xinputXInputExtensioninput devices beyond core pointer/keyboard
xkbXKEYBOARDkeyboard maps, controls, indicators
xtestXTESTsynthesize input events for testing
xvXVideovideo output adaptors

Each extension has its own reference page with every request, event and enum — see the Extensions section of the API reference.