diff options
| author | Richard Purdie <richard@openedhand.com> | 2006-02-09 16:05:01 +0000 |
|---|---|---|
| committer | Richard Purdie <richard@openedhand.com> | 2006-02-09 16:05:01 +0000 |
| commit | e745d175d9a5a5d7a185885a7ca97bbe5797137b (patch) | |
| tree | f68ebebb131af8281b81d0f2c882f284739217e0 /openembedded/packages/chkhinge26/files | |
| parent | ce6bf88ef25fab7f2c36d83a65cad5765051f116 (diff) | |
| download | poky-e745d175d9a5a5d7a185885a7ca97bbe5797137b.tar.gz | |
chkhinge26: Improve the script so its less verbose
git-svn-id: https://svn.o-hand.com/repos/poky@256 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded/packages/chkhinge26/files')
| -rwxr-xr-x | openembedded/packages/chkhinge26/files/hinge-handler | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/openembedded/packages/chkhinge26/files/hinge-handler b/openembedded/packages/chkhinge26/files/hinge-handler index d8100e9b2e..5d5f62e305 100755 --- a/openembedded/packages/chkhinge26/files/hinge-handler +++ b/openembedded/packages/chkhinge26/files/hinge-handler | |||
| @@ -3,6 +3,14 @@ | |||
| 3 | # Quick handler for chkhinge26 and X. | 3 | # Quick handler for chkhinge26 and X. |
| 4 | # | 4 | # |
| 5 | 5 | ||
| 6 | killproc() { # kill the named process(es) | ||
| 7 | pid=`/bin/ps -e x | | ||
| 8 | /bin/grep $1 | | ||
| 9 | /bin/grep -v grep | | ||
| 10 | /bin/sed -e 's/^ *//' -e 's/ .*//'` | ||
| 11 | [ "$pid" != "" ] && kill $pid | ||
| 12 | } | ||
| 13 | |||
| 6 | export DISPLAY=:0 | 14 | export DISPLAY=:0 |
| 7 | 15 | ||
| 8 | if [ -z "$1" ]; then | 16 | if [ -z "$1" ]; then |
| @@ -20,10 +28,10 @@ fi | |||
| 20 | 28 | ||
| 21 | if [ $STATE = "0" ]; then | 29 | if [ $STATE = "0" ]; then |
| 22 | echo "lanscape" | 30 | echo "lanscape" |
| 23 | killall mbinputmgr | 31 | killproc /usr/bin/mbinputmgr |
| 24 | # urg mbinputmgr should kill below | 32 | # urg mbinputmgr should kill below |
| 25 | killall matchbox-keyboard | 33 | killproc /usr/bin/matchbox-keyboard |
| 26 | killall matchbox-stroke | 34 | killproc /usr/bin/matchbox-stroke |
| 27 | xrandr -o normal | 35 | xrandr -o normal |
| 28 | exit 0 | 36 | exit 0 |
| 29 | fi | 37 | fi |
| @@ -33,6 +41,7 @@ if [ $STATE = "2" ]; then | |||
| 33 | xrandr -o left | 41 | xrandr -o left |
| 34 | # just to be extra safe | 42 | # just to be extra safe |
| 35 | sleep 1 | 43 | sleep 1 |
| 36 | mbinputmgr & | 44 | /usr/bin/mbinputmgr & |
| 37 | exit 0 | 45 | exit 0 |
| 38 | fi \ No newline at end of file | 46 | fi |
| 47 | |||
