node-x11/test/xlsatoms.js

25 lines
595 B
JavaScript

var x11 = require('../lib/x11');
var xclient = x11.createClient();
var atomId = 10;
xclient.on('connect', function(display) {
var X = this;
function listAtoms()
{
function getAtom(a)
{
X.GetAtomName(a, function(str) {
if (typeof str != 'string') // 'Bad atom' error
{
X.terminate();
return;
}
console.log(a + ' ' + str);
listAtoms();
});
}
getAtom(atomId);
atomId++;
}
listAtoms();
});