Revised script to accommodate more than 1 screen
Script now rotates up to 4 screens at a time by default
This commit is contained in:
@@ -1,23 +1,28 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# rotate screen clockwise in a complete circle once
|
# rotate all screens clockwise in a complete circle
|
||||||
# by Justin Oros
|
# by Justin Oros
|
||||||
|
|
||||||
myScreenTypes="VGA HDMI DP eDP"
|
screen_types="VGA HDMI DP eDP"
|
||||||
myScreenRotations="normal right inverted left normal"
|
screen_rotations="right inverted left normal"
|
||||||
myScreenNum=1
|
screens=4
|
||||||
mySleepTime=3
|
sleep_time=3
|
||||||
myDisplay=:0
|
display=:0
|
||||||
|
|
||||||
rotate() {
|
rotate() {
|
||||||
export DISPLAY=$myDisplay
|
export DISPLAY=$display
|
||||||
for myScreenRotation in $myScreenRotations
|
for screen_rotation in $screen_rotations
|
||||||
do
|
do
|
||||||
for myScreenType in $myScreenTypes
|
printf "Attempting to rotate screens $screen_rotation...\n"
|
||||||
|
for screen_type in $screen_types
|
||||||
do
|
do
|
||||||
xrandr --output $myScreenType-$myScreenNum --rotate $myScreenRotation > /dev/null 2>&1
|
|
||||||
sleep $mySleepTime
|
for screen in 0 .. $screens
|
||||||
|
do
|
||||||
|
xrandr --output $screen_type-$screen --rotate $screen_rotation > /dev/null 2>&1
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
sleep $sleep_time
|
||||||
|
done
|
||||||
}
|
}
|
||||||
rotate
|
rotate
|
||||||
|
|||||||
Reference in New Issue
Block a user