Skip to content

Instantly share code, notes, and snippets.

@sidorares
Created November 6, 2012 14:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sidorares/4025095 to your computer and use it in GitHub Desktop.
Save sidorares/4025095 to your computer and use it in GitHub Desktop.
dbus 'device added' signal listener
var dbus = require('dbus-native');
var bus = dbus.systemBus();
udservice = bus.getService('org.freedesktop.UDisks');
udservice.getInterface(
'/org/freedesktop/UDisks',
'org.freedesktop.UDisks',
function(err, ud) {
ud.on('DeviceAdded', function(deviceObjectPath) {
console.log('DeviceAdded', deviceObjectPath);
});
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment