#!/bin/sh orientation=`xrandr --verbose | grep LVDS | awk '{print $5}'` if [ $orientation = 'normal' ] then xrandr -o left elif [ $orientation = 'left' ] then xrandr -o inverted elif [ $orientation = 'inverted' ] then xrandr -o right elif [ $orientation = 'right' ] then xrandr -o normal fi