Created
July 23, 2013 15:20
-
-
Save jjrh/6063218 to your computer and use it in GitHub Desktop.
Rotates your screen remembering the last position.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
check_file="/home/jjrh/scripts/rotation_status" | |
screen="HDMI1" | |
#if the rotation file doesn't exist create it and assume normal. | |
if [ ! -e $check_file ] | |
then | |
touch $check_file | |
echo "normal" > $check_file | |
fi | |
if [ $(cat $check_file) = "left" ] | |
then | |
xrandr --output $screen --rotate normal | |
echo "normal" > $check_file | |
elif [ $(cat $check_file) = "normal" ] | |
then | |
xrandr --output $screen --rotate left | |
echo "left" > $check_file | |
else | |
echo "you probably got garbage that isn't 'left' or 'normal' in your file!" | |
# echo "normal" > $check_file # uncomment to initialize the file. | |
# ./rotate.sh | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment