Actually decrement usage count when releasing a service
[gregoa/zavai.git] / src / app_keyboard.vala
index 7d38b7887de5ac0fee82b2301dbdbc865f655cf5..31c049276712cedc55f05c8d74b133e1eca8f3a2 100644 (file)
@@ -42,7 +42,9 @@ public class Keyboard : Service
 
     protected override void start()
     {
-        string[] args = { zavai.config.homedir + "/keyboard", null };
+        string script = zavai.config.find_script("keyboard");
+        if (script == null) return;
+        string[] args = { script, null };
         int opid;
         try {
             Gdk.spawn_on_screen(
@@ -112,50 +114,18 @@ public class KeyboardIcon : Gtk.StatusIcon
     }
 }
 
-/*
-public class GPSRequestLink : Gtk.ToggleButton
-{
-    public GPSRequestLink()
-    {
-        // GPS status icon
-        status_icon = new Gtk.StatusIcon();
-        status_icon.set_visible(true);
-        status_icon.activate += on_status_activate;
-        update_icon();
-    }
-
-    private void on_fix_status_changed(dynamic DBus.Object pos, int fix_status)
-    {
-        this.fix_status = fix_status;
-        update_icon();
-    }
-
-    private void on_toggled(Gtk.Button src)
-    {
-        Service s = zavai.registry.gets(service_name);
-        if (get_active())
-            s.request("servicerequestlink");
-        else
-            s.release("servicerequestlink");
-        set_label(get_active() ? label_stop : label_start);
-        update_icon();
-    }
-
-    private void on_status_activate()
-    {
-        set_active(!get_active());
-    }
-}
-*/
 
 Keyboard keyboard;
 KeyboardIcon icon;
 
 public void init()
 {
-    keyboard = new Keyboard();
-    icon = new KeyboardIcon();
-    icon.set_visible(true);
+    if (zavai.config.profile != "laptop")
+    {
+        keyboard = new Keyboard();
+        icon = new KeyboardIcon();
+        icon.set_visible(true);
+    }
 }
 
 }