]> code.ossystems Code Review - openembedded-core.git/commitdiff
chkhinge26: Improve the script so its less verbose
authorRichard Purdie <richard@openedhand.com>
Thu, 9 Feb 2006 16:05:01 +0000 (16:05 +0000)
committerRichard Purdie <richard@openedhand.com>
Thu, 9 Feb 2006 16:05:01 +0000 (16:05 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky@256 311d38ba-8fff-0310-9ca6-ca027cbcb966

openembedded/packages/chkhinge26/chkhinge26_svn.bb
openembedded/packages/chkhinge26/files/hinge-handler

index b265fe6c877a22b7ea8978a47db30e1647529321..5313401b50951e7334c9e91dbfe79450cbabe6d3 100755 (executable)
@@ -2,7 +2,7 @@ LICENSE = "LGPL"
 SECTION = "x11"
 MAINTAINER = "Matthew Allum <mallum@openedhand.com>"
 DESCRIPTION = "Chkhinge26 fires off cmds on cXXXX Zs."
-PR = "r1"
+PR = "r2"
 
 SRC_URI = "svn://svn.o-hand.com/repos/misc/trunk;module=chkhinge26;proto=http \
           file://hinge-handler"
index d8100e9b2e4018b4a0da6df0237e3ac3ba5a70b5..5d5f62e305f4e82f32eb5cef8bd10bea91cec161 100755 (executable)
@@ -3,6 +3,14 @@
 # Quick handler for chkhinge26 and X. 
 #
 
+killproc() {            # kill the named process(es)
+        pid=`/bin/ps -e x |
+             /bin/grep $1 |
+             /bin/grep -v grep |
+             /bin/sed -e 's/^  *//' -e 's/ .*//'`
+        [ "$pid" != "" ] && kill $pid
+}
+
 export DISPLAY=:0
 
 if [ -z "$1" ]; then
@@ -20,10 +28,10 @@ fi
 
 if [ $STATE = "0" ]; then
    echo "lanscape"
-   killall mbinputmgr
+   killproc /usr/bin/mbinputmgr
 # urg mbinputmgr should kill below
-   killall matchbox-keyboard
-   killall matchbox-stroke
+   killproc /usr/bin/matchbox-keyboard
+   killproc /usr/bin/matchbox-stroke
    xrandr -o normal
    exit 0
 fi
@@ -33,6 +41,7 @@ if [ $STATE = "2" ]; then
    xrandr -o left 
 # just to be extra safe
    sleep 1 
-   mbinputmgr &
+   /usr/bin/mbinputmgr &
    exit 0
-fi
\ No newline at end of file
+fi
+