rendered paste body#!/bin/bash#### rotate.sh - A script for tablet PCs to rotate the display.## This software is licensed under the CC-GNU GPL.## http://creativecommons.org/licenses/GPL/2.0/## http://wiki.archlinux.org/index.php/Tablet_PC## REQUIRES: linuxwacom (http://linuxwacom.sourceforge.net/) #### Function(s)function set_normal {xrandr -o normalxsetwacom set "stylus" Rotate 0xsetwacom set "cursor" Rotate 0xsetwacom set "eraser" Rotate 0orientation="normal"}function set_right {xrandr -o rightxsetwacom set "stylus" Rotate 1xsetwacom set "cursor" Rotate 1xsetwacom set "eraser" Rotate 1orientation="right"}function set_left {xrandr -o leftxsetwacom set "stylus" Rotate 2xsetwacom set "cursor" Rotate 2xsetwacom set "eraser" Rotate 2orientation="left"}function set_inverted {xrandr -o invertedxsetwacom set "stylus" Rotate 3xsetwacom set "cursor" Rotate 3xsetwacom set "eraser" Rotate 3orientation="inverted"}#### Variable(s)orientation="$(xrandr --query --verbose | grep '(normal left inverted right)' | awk '{print $5}')"#### Mainif [ "$orientation" = "normal" ]; then set_rightelif [ "$orientation" = "right" ]; then set_invertedelif [ "$orientation" = "inverted" ]; then set_leftelif [ "$orientation" = "left" ]; then set_normalfi#### EOF