Client: Subscribe arg now prints when first called

This commit is contained in:
Erik Reider 2021-07-31 12:46:26 +02:00
parent 780887f0b9
commit de55a18227
2 changed files with 11 additions and 3 deletions

View File

@ -3,9 +3,11 @@ interface CcDaemon : GLib.Object {
public abstract uint notification_count () throws DBusError, IOError;
public abstract bool get_dnd () throws DBusError, IOError;
public abstract void toggle () throws DBusError, IOError;
public abstract uint toggle_dnd () throws DBusError, IOError;
public abstract bool toggle_dnd () throws DBusError, IOError;
public signal void subscribe (uint count, bool dnd);
}
@ -56,6 +58,8 @@ public int command_line (string[] args) {
case "--subscribe":
case "-s":
cc_daemon.subscribe.connect ((c, d) => on_subscribe (c, d));
on_subscribe (cc_daemon.notification_count (),
cc_daemon.get_dnd ());
var loop = new MainLoop ();
loop.run ();
break;

View File

@ -37,8 +37,12 @@ namespace SwayNotificatonCenter {
}
}
public uint toggle_dnd () throws DBusError, IOError {
return dbusInit.notiDaemon.toggle_dnd () == true ? 1 : 0;
public bool toggle_dnd () throws DBusError, IOError {
return dbusInit.notiDaemon.toggle_dnd ();
}
public bool get_dnd () throws DBusError, IOError {
return dbusInit.notiDaemon.get_dnd ();
}
public void add_notification (NotifyParams param) throws DBusError, IOError {