desktop->shared

This commit is contained in:
Daniel Bauer
2020-02-20 10:32:33 +01:00
parent f73d80c03f
commit 683a113df7
44 changed files with 470 additions and 62 deletions

View File

@@ -0,0 +1,27 @@
#!/bin/bash
EXTERNAL_OUTPUT="HDMI2"
INTERNAL_OUTPUT="eDP1"
# if we don't have a file, start at zero
if [ ! -f "/tmp/monitor_mode.dat" ] ; then
monitor_mode="all"
# otherwise read the value from the file
else
monitor_mode=`cat /tmp/monitor_mode.dat`
fi
if [ $monitor_mode = "all" ]; then
monitor_mode="EXTERNAL"
xrandr --output $INTERNAL_OUTPUT --off --output $EXTERNAL_OUTPUT --auto
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
fi
echo "${monitor_mode}" > /tmp/monitor_mode.dat