Files
Bash/rotate.sh
T

29 lines
551 B
Bash
Raw Normal View History

2020-02-12 15:52:08 -07:00
#!/bin/bash
# rotate all screens clockwise in a complete circle
2020-02-12 15:52:08 -07:00
# by Justin Oros
screen_types="VGA HDMI DP eDP"
screen_rotations="right inverted left normal"
screens=4
sleep_time=3
display=:0
2020-02-12 15:52:08 -07:00
rotate() {
export DISPLAY=$display
for screen_rotation in $screen_rotations
2020-02-12 15:52:08 -07:00
do
printf "Attempting to rotate screens $screen_rotation...\n"
for screen_type in $screen_types
do
for screen in 0 .. $screens
do
xrandr --output $screen_type-$screen --rotate $screen_rotation > /dev/null 2>&1
done
done
sleep $sleep_time
2020-02-12 15:52:08 -07:00
done
}
rotate