summaryrefslogtreecommitdiff
path: root/openembedded/packages/chkhinge26/files/hinge-handler
blob: 12d0172e422da83b1282b677bf7962b2d95c2717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
#
# Quick handler for chkhinge26 and X. 
#

export DISPLAY=:0

if [ -z "$1" ]; then
   echo "Usage: hinge-handler <state> ( 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"
   killall mbinputmgr
   xrand -o normal
   exit 0
fi

if [ $STATE = "2" ]; then
   echo "portrait"
   mbinputmgr &
   xrandr -o left
   exit 0
fi