Example: curl -s https://raw.githubusercontent.com/JustinOros/bash_scripts/master/rotate.sh | bash
24 lines
464 B
Bash
24 lines
464 B
Bash
#!/bin/bash
|
|
|
|
# rotate screen clockwise in a complete circle once
|
|
# by Justin Oros
|
|
|
|
myScreenTypes="VGA HDMI DP eDP"
|
|
myScreenRotations="normal right inverted left normal"
|
|
myScreenNum=1
|
|
mySleepTime=3
|
|
myDisplay=:0
|
|
|
|
rotate() {
|
|
export DISPLAY=$myDisplay
|
|
for myScreenRotation in $myScreenRotations
|
|
do
|
|
for myScreenType in $myScreenTypes
|
|
do
|
|
xrandr --output $myScreenType-$myScreenNum --rotate $myScreenRotation > /dev/null 2>&1
|
|
sleep $mySleepTime
|
|
done
|
|
done
|
|
}
|
|
rotate
|