#!/bin/sh # On the HP, rotation is (normally) CW or NORMAL x_min=0 x_max=24700 y_min=0 y_max=18520 function ROTATE() { curr=`xrandr | awk '/Current rotation/ { print $4 }'` case $curr in normal) CW ;; *) NORMAL ;; esac } function PORTRAIT() { #xsetwacom set Eraser BottomX $x_max #xsetwacom set Eraser BottomY $y_max echo portrait } function LANDSCAPE() { #xsetwacom set Eraser BottomX $y_max #xsetwacom set Eraser BottomY $x_max echo landscape } function NORMAL() { xrandr -o normal xsetwacom set Stylus Rotate NONE xsetwacom set Eraser Rotate NONE PORTRAIT } function CCW() { xrandr -o right xsetwacom set Stylus Rotate CCW xsetwacom set Eraser Rotate CCW LANDSCAPE } function CW() { xrandr -o right xsetwacom set Stylus Rotate CW xsetwacom set Eraser Rotate CW LANDSCAPE } function INVERT() { xrandr -o inverted xsetwacom set Stylus Rotate UD xsetwacom set Eraser Rotate UD LANDSCAPE } case $1 in -l) CCW ;; -r) CW ;; -n) NORMAL ;; -i) INVERT ;; *) ROTATE ;; esac