summaryrefslogtreecommitdiffstats
path: root/meta/packages/chkhinge26
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/chkhinge26')
-rwxr-xr-xmeta/packages/chkhinge26/chkhinge26_svn.bb20
-rwxr-xr-xmeta/packages/chkhinge26/files/hinge-handler47
2 files changed, 67 insertions, 0 deletions
diff --git a/meta/packages/chkhinge26/chkhinge26_svn.bb b/meta/packages/chkhinge26/chkhinge26_svn.bb
new file mode 100755
index 0000000000..5313401b50
--- /dev/null
+++ b/meta/packages/chkhinge26/chkhinge26_svn.bb
@@ -0,0 +1,20 @@
1LICENSE = "LGPL"
2SECTION = "x11"
3MAINTAINER = "Matthew Allum <mallum@openedhand.com>"
4DESCRIPTION = "Chkhinge26 fires off cmds on cXXXX Zs."
5PR = "r2"
6
7SRC_URI = "svn://svn.o-hand.com/repos/misc/trunk;module=chkhinge26;proto=http \
8 file://hinge-handler"
9
10S = "${WORKDIR}/${PN}"
11
12inherit autotools pkgconfig
13
14do_install_append () {
15 install -m 0755 ${WORKDIR}/hinge-handler ${D}/${bindir}/
16}
17
18FILES_${PN} += "${bindir}/hinge-handler"
19
20
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
6killproc() { # 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
14export DISPLAY=:0
15
16if [ -z "$1" ]; then
17 echo "Usage: hinge-handler <state> ( 3 = closed, 0 = landscape, 2 = portrait )"
18 exit 1
19fi
20
21STATE=$1
22
23if [ $STATE = "3" ]; then
24 echo "sleeping"
25 apm -s
26 exit 0
27fi
28
29if [ $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
37fi
38
39if [ $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
46fi
47