From b2f192faabe412adce79534e22efe9fb69ee40e2 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 21 Jul 2006 10:10:31 +0000 Subject: Rename /openembedded/ -> /meta/ git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- meta/packages/chkhinge26/files/hinge-handler | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 meta/packages/chkhinge26/files/hinge-handler (limited to 'meta/packages/chkhinge26/files') 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 @@ +#!/bin/sh +# +# 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 + echo "Usage: hinge-handler ( 3 = closed, 0 = landscape, 2 = portrait )" + exit 1 +fi + +STATE=$1 + +if [ $STATE = "3" ]; then + echo "sleeping" + apm -s + exit 0 +fi + +if [ $STATE = "0" ]; then + echo "lanscape" + killproc /usr/bin/mbinputmgr +# urg mbinputmgr should kill below + killproc /usr/bin/matchbox-keyboard + killproc /usr/bin/matchbox-stroke + xrandr -o normal + exit 0 +fi + +if [ $STATE = "2" ]; then + echo "portrait" + xrandr -o left +# just to be extra safe + sleep 1 + /usr/bin/mbinputmgr & + exit 0 +fi + -- cgit v1.2.3-54-g00ecf