mirror of
https://github.com/danbulant/node-x11
synced 2026-05-21 05:19:14 +00:00
28 lines
701 B
JavaScript
28 lines
701 B
JavaScript
var x11 = require('../lib/x11');
|
|
|
|
var xclient = x11.createClient();
|
|
var atomId = 1;
|
|
xclient.on('connect', function(display) {
|
|
var X = this;
|
|
function listAtoms()
|
|
{
|
|
function getAtom(a)
|
|
{
|
|
X.GetAtomName(a, function(str) {
|
|
if (a == 1)
|
|
console.log('module.exports = {')
|
|
if (a != 68)
|
|
console.log(' %s: %d,', str, a);
|
|
else
|
|
console.log(' %s: %d\n}', str, a);
|
|
listAtoms();
|
|
});
|
|
}
|
|
if (atomId <= 68)
|
|
getAtom(atomId);
|
|
else
|
|
X.terminate();
|
|
atomId++;
|
|
}
|
|
listAtoms();
|
|
});
|