Files
dotfiles/profiles/i3/.config/i3/scripts/change_monitor.sh
2022-12-10 17:43:32 +01:00

21 lines
530 B
Bash
Executable File

#!/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="CLONES"
# otherwise read the value from the file
else
monitor_mode=`cat /tmp/monitor_mode.dat`
fi
if [ $monitor_mode = "CLONES" ]; then
monitor_mode="EXTERNAL"
$HOME/.screenlayout/external.sh
elif [ $monitor_mode = "EXTERNAL" ]; then
monitor_mode="CLONES"
$HOME/.screenlayout/clone.sh
fi
echo "${monitor_mode}" > /tmp/monitor_mode.dat