You can also make the special rotation key work using xbinkeys. Just copy the rc file into your home dir. You'll need to add xbindkeys to your startup routine.
Use the auto snippet tool to get keycodes:
xbinkeys -k
"bash rotate_display flip" | |
m:0x0 + c:161 | |
NoSymbol |
#!/bin/bash | |
# config | |
output="LVDS1" | |
# get current rotation | |
current=`xrandr -q --verbose|grep LVDS1|cut -d ' ' -f6` | |
case $current in | |
normal) geom=0;; | |
left) geom=1;; | |
inverted) geom=2;; | |
right) geom=3;; | |
esac | |
if [ "$1" == "flip" ] || [ "$1" == "rotate" ]; | |
then | |
# based on current rotation set new rotation | |
if [ "$1" == "flip" ]; | |
then | |
# flip | |
if [ "$geom" == "0" ]; | |
then | |
wacom=cw | |
xrandr=right | |
else | |
wacom=none | |
xrandr=normal | |
fi | |
else | |
# rotate | |
case $geom in | |
0) wacom=cw; xrandr=right;; | |
3) wacom=half; xrandr=inverted;; | |
2) wacom=ccw; xrandr=left;; | |
1) wacom=none; xrandr=normal;; | |
esac | |
fi | |
echo "xrandr to $xrandr, xsetwacom to $wacom" >&2 | |
# rotate display | |
xrandr -o $xrandr | |
# rotate wacom | |
xsetwacom set "13" Rotate $wacom | |
xsetwacom set "14" Rotate $wacom | |
xsetwacom set "15" Rotate $wacom | |
else | |
echo "possible parameters: flip, rotate" | |
fi |