using GLib;
public class Pronto {
private DBusConnection dbusConn;
private uint filterFuncId;
public Pronto() {
try {
// Get the session bus
this.dbusConn = Bus.get_sync(BusType.SESSION);
} catch (IOError ioe) {
// Print out the error and run for the hills!
stdout.printf("Unable to obtain the session bus. [%s]\n", ioe.message);
Posix.exit(1);
}
}
public void setup() {
// Add our filter function
this.filterFuncId = this.dbusConn.add_filter(this.messageFilter);
}
public unowned DBusMessage messageFilter(DBusConnection connection, DBusMessage message, bool incoming) {
if (message.get_interface() == "org.freedesktop.Notifications" && message.get_member() == "Notify") {
}
return message;
}
public static int main (string[] args) {
var p = new Pronto();
p.setup();
var mainLoop = new MainLoop();
mainLoop.run();
return 0;
}
}