#!/bin/sh # # Quick handler for chkhinge26 and X. # 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" if [ -x @bindir@/apm ]; then apm -s fi exit 0 fi if [ $STATE = "0" ]; then #echo "lanscape" if [ -x @bindir@/xrandr ]; then xrandr -o normal fi exit 0 fi if [ $STATE = "2" ]; then #echo "portrait" if [ -x @bindir@/xrandr ]; then @bindir@/xrandr -o left fi exit 0 fi