May 25, 2007 Archives

2007-05-25 01:24:00

Shell script for rotating display under Ubuntu Linux

I wrote a small script for change the orientation of my Fujitsu T4020 under Ubuntu. The script only works in Ubuntu but not Fedora Core because Fedora uses older version wacom tool by default.
#!/bin/bash
# Rotate orientation of display for a tablet pc.
# Yi-Ming Chu
RSTATUS=$(xrandr -q|grep "Current rotation")
if [ "$RSTATUS" == "Current rotation - normal" ]; then
	xrandr -o right
	xsetwacom set stylus Rotate cw
elif [ "$RSTATUS" == "Current rotation - right" ]; then
	xrandr -o normal
	xsetwacom set stylus Rotate none
else
	echo "Somthing wrong! Are you using a tablet pc?"
fi

However, I re-installed this tablet pc with Windows XP Tablet PC edition later. The tablet keys are still not functional. :-(

Posted by Wesly Chu | Permanent Link | Categories: Linux Script Note