PDA

View Full Version : HOWTO: Persistent monitor rotation


jackmcslay
March 7th, 2009, 06:22 PM
This is a fix that allows for persistent configuration of tho monitor's pivot rotation. You most create two scripts:

screen-rotate
#!/bin/bash
if [ "$1" = "right" ]
then
rotate="right"
else
rotate="left"
fi


if xrandr | grep "$rotate ("

then
rotate="normal"
fi
xrandr -o "$rotate"

echo $rotate > ~/.screen-orientation

screen-rotate-setup
#!/bin/bash
rotate=`cat ~/.screen-orientation`
xrandr -o $rotate

save both scripts to /usr/bin (via sudo, of course) and give them execution permissions to everyone (chmod +x)

Now go to System>Preferences>Sessions, click add and put screen-rotate-setup as the command. Name it as you see fit.

Now create a shortcut somewhere (the taskbar, perhaps?) put as a the command screen-rotate(in case your monitor rotates clockwise) or screen-rotate right(in case your monitor rotates counter-clockwise).

New click on the shortcut, log out ane then log n again and... voilá!