mirror of
https://github.com/danbulant/node-x11
synced 2026-06-14 20:21:40 +00:00
25 lines
595 B
JavaScript
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();
|
|
});
|