diff --git a/src/client.vala b/src/client.vala index c39f9a7..584b1d4 100644 --- a/src/client.vala +++ b/src/client.vala @@ -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; diff --git a/src/controlCenter/controlCenter.vala b/src/controlCenter/controlCenter.vala index 4d91b6d..9fb0873 100644 --- a/src/controlCenter/controlCenter.vala +++ b/src/controlCenter/controlCenter.vala @@ -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 {