This commit is contained in:
danijoo
2021-11-09 12:00:37 +01:00
parent 6b68c188a4
commit 4f6591b8d8
5 changed files with 120 additions and 18 deletions

View File

@@ -4,24 +4,17 @@ INTERNAL_OUTPUT="eDP1"
# if we don't have a file, start at zero
if [ ! -f "/tmp/monitor_mode.dat" ] ; then
monitor_mode="all"
monitor_mode="CLONES"
# otherwise read the value from the file
else
monitor_mode=`cat /tmp/monitor_mode.dat`
fi
if [ $monitor_mode = "all" ]; then
if [ $monitor_mode = "CLONES" ]; then
monitor_mode="EXTERNAL"
xrandr --output $INTERNAL_OUTPUT --off --output $EXTERNAL_OUTPUT --auto
$HOME/.screenlayout/external.sh
elif [ $monitor_mode = "EXTERNAL" ]; then
monitor_mode="INTERNAL"
xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --off
elif [ $monitor_mode = "INTERNAL" ]; then
monitor_mode="CLONES"
xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --auto --same-as $INTERNAL_OUTPUT
else
monitor_mode="all"
xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --auto --right-of $INTERNAL_OUTPUT
$HOME/.screenlayout/clone.sh
fi
echo "${monitor_mode}" > /tmp/monitor_mode.dat