Package hooks in hooks/ directory, document it, and call keyboard hook to show the...
authorEnrico Zini <enrico@enricozini.org>
Tue, 13 Oct 2009 09:25:39 +0000 (10:25 +0100)
committerEnrico Zini <enrico@enricozini.org>
Tue, 13 Oct 2009 09:25:39 +0000 (10:25 +0100)
debian/README.Debian
debian/zavai.install
debian/zavai_launch_kbd [deleted file]
hooks/display [new file with mode: 0755]
hooks/keyboard [new file with mode: 0755]
hooks/keyboard.fil [new file with mode: 0755]
src/app_keyboard.vala
src/display [deleted file]

index 485a7578f94ffdd1927606b6da7b27d923d29a54..a2aea3ce7d05737fe6692fcac1a2047011b29636 100644 (file)
@@ -16,7 +16,11 @@ user that will be running X, thus:
 
 Also copy the example 'display' script there:
 
-   cp /usr/share/doc/zavai/examples/display ~/.zavai
+   ln -s /usr/share/doc/zavai/examples/display ~/.zavai
+
+And the script you want to use to run your favourite keyboard:
+
+   ln -s /usr/share/doc/zavai/examples/keyboard ~/.zavai
 
 If you're running X as non-root, you'll need to add that user to group
 messagebus.
index 4b5b6a6680ebb670904c0165b25e99719fd045b6..38ae9de1de936db8486f2b45192c14b80658ed1a 100644 (file)
@@ -1,7 +1,8 @@
 conf/zavai.conf etc/dbus-1/system.d
 icons usr/share/zavai
-src/display usr/share/doc/zavai/examples
+hook/display usr/share/doc/zavai/examples
+hook/keyboard usr/share/doc/zavai/examples
+hook/keyboard.fil usr/share/doc/zavai/examples
 debian/zavai_forever usr/bin
-debian/zavai_launch_kbd usr/bin
 lindi/om-device usr/bin
 lindi/om-make-sysfsrc usr/bin
diff --git a/debian/zavai_launch_kbd b/debian/zavai_launch_kbd
deleted file mode 100755 (executable)
index 8a96dc3..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-# I'm sure there is some clever way to make the WM inflict transparency on the keyboard,
-# but I don't know what it is, so for now a dodgy hack
-
-make_transparent() {
-  sleep 5
-  /usr/bin/transset-df -n xvkbd .4
-}
-
-make_transparent &
-exec /usr/bin/xvkbd
diff --git a/hooks/display b/hooks/display
new file mode 100755 (executable)
index 0000000..7fb032c
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+case "$1" in
+       # At the start of zavai
+       init)
+               xset dpms 0 0 30
+               echo 30 > ~/.zavai/blank-timeout
+       ;;
+       # When setting the display to always on
+       lock_on)
+               xset dpms force on
+               xset dpms 0 0 0
+               echo 0 > ~/.zavai/blank-timeout
+       ;;
+       # When locking the screen with the backlight allowed to fade
+       lock_off)
+               xset dpms force off
+               xset dpms 0 0 5
+               echo 5 > ~/.zavai/blank-timeout
+       ;;
+       # Temporarily turn on (for example, to read the time)
+       wiggle)
+               xset dpms force on
+               xset dpms 0 0 `cat ~/.zavai/blank-timeout`
+       ;;
+       defaults)
+               xset dpms force on
+               xset dpms 0 0 30
+               echo 30 > ~/.zavai/blank-timeout
+       ;;
+       *)
+               echo "Invalid option '$1'." >&2
+               exit 1
+       ;;
+esac
+
+exit 0
diff --git a/hooks/keyboard b/hooks/keyboard
new file mode 100755 (executable)
index 0000000..e3676e9
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Use exec, so that zavai kills the right think when it kills the pid of this
+# script
+
+exec /usr/bin/matchbox-keyboard
diff --git a/hooks/keyboard.fil b/hooks/keyboard.fil
new file mode 100755 (executable)
index 0000000..8a96dc3
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# I'm sure there is some clever way to make the WM inflict transparency on the keyboard,
+# but I don't know what it is, so for now a dodgy hack
+
+make_transparent() {
+  sleep 5
+  /usr/bin/transset-df -n xvkbd .4
+}
+
+make_transparent &
+exec /usr/bin/xvkbd
index 66f6600129ab75905a7f33332ee54733bdf3cd93..794bf01c9e02bbfa70d7901503839d3e06f2dbd0 100644 (file)
@@ -42,7 +42,7 @@ public class Keyboard : Service
 
        protected override void start()
        {
-               string[] args = { "/usr/bin/zavai_launch_kbd", null };
+               string[] args = { zavai.config.homedir + "/keyboard", null };
                int opid;
                try {
                        Gdk.spawn_on_screen(
@@ -57,7 +57,7 @@ public class Keyboard : Service
                        ChildWatch.add(pid, on_child_quit);
                        base.start();
                } catch (Error e) {
-                       log.error("Running matchbox-keyboard: " + e.message);
+                       log.error("Running " + zavai.config.homedir + "/keyboard: " + e.message);
                        pid = (Pid)0;
                }
        }
diff --git a/src/display b/src/display
deleted file mode 100755 (executable)
index 7fb032c..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-case "$1" in
-       # At the start of zavai
-       init)
-               xset dpms 0 0 30
-               echo 30 > ~/.zavai/blank-timeout
-       ;;
-       # When setting the display to always on
-       lock_on)
-               xset dpms force on
-               xset dpms 0 0 0
-               echo 0 > ~/.zavai/blank-timeout
-       ;;
-       # When locking the screen with the backlight allowed to fade
-       lock_off)
-               xset dpms force off
-               xset dpms 0 0 5
-               echo 5 > ~/.zavai/blank-timeout
-       ;;
-       # Temporarily turn on (for example, to read the time)
-       wiggle)
-               xset dpms force on
-               xset dpms 0 0 `cat ~/.zavai/blank-timeout`
-       ;;
-       defaults)
-               xset dpms force on
-               xset dpms 0 0 30
-               echo 30 > ~/.zavai/blank-timeout
-       ;;
-       *)
-               echo "Invalid option '$1'." >&2
-               exit 1
-       ;;
-esac
-
-exit 0