Skip to content

Instantly share code, notes, and snippets.

@ar-nelson
Created August 24, 2013 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ar-nelson/6330380 to your computer and use it in GitHub Desktop.
Save ar-nelson/6330380 to your computer and use it in GitHub Desktop.
Simple node.js script that prints wmii events as they occur.
var spawn = require('child_process').spawn;
var stdin = process.openStdin();
var reader = spawn('wmiir', ['read', '/event']);
reader.stdout.on('data', function(data) {
console.log("Got event: " + data);
});
console.log("Press ENTER to exit.");
stdin.on('data', function(data) {
reader.kill();
process.exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment