diff options
author | Richard Purdie <richard@openedhand.com> | 2006-07-21 10:10:31 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2006-07-21 10:10:31 +0000 |
commit | b2f192faabe412adce79534e22efe9fb69ee40e2 (patch) | |
tree | 7076c49d4286f8a1733650bd8fbc7161af200d57 /meta/packages/chkhinge26/files/hinge-handler | |
parent | 2cf0eadf9f730027833af802d7e6c90b44248f80 (diff) | |
download | poky-b2f192faabe412adce79534e22efe9fb69ee40e2.tar.gz |
Rename /openembedded/ -> /meta/
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/chkhinge26/files/hinge-handler')
-rwxr-xr-x | meta/packages/chkhinge26/files/hinge-handler | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/meta/packages/chkhinge26/files/hinge-handler b/meta/packages/chkhinge26/files/hinge-handler new file mode 100755 index 0000000000..5d5f62e305 --- /dev/null +++ b/meta/packages/chkhinge26/files/hinge-handler | |||
@@ -0,0 +1,47 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Quick handler for chkhinge26 and X. | ||
4 | # | ||
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 | |||
14 | export DISPLAY=:0 | ||
15 | |||
16 | if [ -z "$1" ]; then | ||
17 | echo "Usage: hinge-handler <state> ( 3 = closed, 0 = landscape, 2 = portrait )" | ||
18 | exit 1 | ||
19 | fi | ||
20 | |||
21 | STATE=$1 | ||
22 | |||
23 | if [ $STATE = "3" ]; then | ||
24 | echo "sleeping" | ||
25 | apm -s | ||
26 | exit 0 | ||
27 | fi | ||
28 | |||
29 | if [ $STATE = "0" ]; then | ||
30 | echo "lanscape" | ||
31 | killproc /usr/bin/mbinputmgr | ||
32 | # urg mbinputmgr should kill below | ||
33 | killproc /usr/bin/matchbox-keyboard | ||
34 | killproc /usr/bin/matchbox-stroke | ||
35 | xrandr -o normal | ||
36 | exit 0 | ||
37 | fi | ||
38 | |||
39 | if [ $STATE = "2" ]; then | ||
40 | echo "portrait" | ||
41 | xrandr -o left | ||
42 | # just to be extra safe | ||
43 | sleep 1 | ||
44 | /usr/bin/mbinputmgr & | ||
45 | exit 0 | ||
46 | fi | ||
47 | |||