No description
Find a file
Antti Korpi fd09ef9848 Nail devDependencies to specific version
This documents what versions it's supposed to work with, and reduces
potential future confusion if contributors accidentally work with
different tool versions.
2018-01-23 21:59:21 +01:00
autogen initial implementation of xcb xml -> js generation 2012-11-27 11:42:57 +11:00
examples png rendering example 2016-11-30 18:37:13 +02:00
lib Added ShapeNotify event parsing 2017-08-26 17:00:10 +02:00
test Add test for ChangeGC. 2017-08-04 12:05:05 -04:00
.travis.yml added node 6 7 regression 2017-04-20 22:36:23 -07:00
Changelog.md start changelog 2015-02-19 20:45:06 +11:00
LICENSE year bump 2012-06-13 15:14:12 +10:00
package.json Nail devDependencies to specific version 2018-01-23 21:59:21 +01:00
README.md Readme cleanup 2017-07-20 17:07:56 +01:00
roadmap.txt tick what's done 2012-11-27 11:38:33 +11:00
test-runner.js Check for errors directly instead of with isError 2014-11-03 16:43:37 +01:00

node-x11

X11 protocol client for Node.js: implements the core X11 protocol, as well as Xrender, Damage, Composite, Big-Requests, Dpms, Screensaver, XFixes, Shape, XTest, XC-Misc, GLX, and Apple-WM extensions.

Gitter Build Status

Install

npm install x11

Windows users:

  1. install XMing or Cygwin/X
  2. get node-x11 copy (using git or from Github)

Example

Core requests usage:

var x11 = require('x11');

var Exposure = x11.eventMask.Exposure;
var PointerMotion = x11.eventMask.PointerMotion;

x11.createClient(function(err, display) {
    if (!err) {
        var X = display.client;
        var root = display.screen[0].root;
        var wid = X.AllocID();
        X.CreateWindow(
            wid, root,        // new window id, parent
            0, 0, 100, 100,   // x, y, w, h
            0, 0, 0, 0,       // border, depth, class, visual
            { eventMask: Exposure|PointerMotion } // other parameters
        );
        X.MapWindow(wid);
        var gc = X.AllocID();
        X.CreateGC(gc, wid);
        X.on('event', function(ev) {
            if (ev.type == 12)
            {
                X.PolyText8(wid, gc, 50, 50, ['Hello, Node.JS!']);
            }
        });
        X.on('error', function(e) {
            console.log(e);
        });
    } else {
        console.log(err);
    }
});

Screenshots

tetris game XRENDER gradients OpenGL glxgears OpenGL teapot

In use

  • ntk - higher level toolkit on top of X11
  • node-remote - media center controller
  • tiles - tiling window manager
  • vnc - vnc client.
  • node-ewmh - set of EWMH helpers.
  • OdieWM - window manager
  • Dbusmenu - unity global menu client.
  • AirWM - tiling window manager
  • npdf - pdf viewer
  • tinywm The famous TinyWM written in node.js
  • basedwm Infinite-desktop panning X window manager in LiveScript

X11 resources/documentation:

Other implementations

Server side (protocol + functionality) implementations for js + DOM

would be really great to make completely web based playground page, connecting node-x11 api to DOM based implementation