Managed to export a proper dbus interface for alarm notification
[gregoa/zavai.git] / src / zavai.vala
index 33e0bd72c09417fe7cddb69925136a84686763c7..467aab667ecd0f612473e2aa6375e85de3ed4801 100644 (file)
@@ -58,7 +58,7 @@ static int main (string[] args) {
        return 0;
 */
 
-       if (args[1] == "notify")
+       if (args.length > 1 && args[1] == "notify")
        {
                DBus.Connection sbus;
                dynamic DBus.Object zav;
@@ -71,11 +71,12 @@ static int main (string[] args) {
                // see mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage
                zav = sbus.get_object(
                        "org.enricozini.zavai",
-                       "/",
-                       "org.freesmartphone.Notification");
-               zav.AtAlarm("ciao");
-               //      "org.enricozini.zavai.Alarm");
-               //zav.Notify();
+                       "/org/enricozini/Zavai/Clock",
+                       "org.enricozini.zavai.Alarm");
+               if (args.length > 2)
+                       zav.Notify(args[2]);
+               else
+                       zav.Notify("Alarm");
                
                return 0;
        }