while :; do
NEWDISPLAYCOUNT="$(xrandr | grep -c '[^s]connected')"
if ! [ "$DISPLAYCOUNT" = "$NEWDISPLAYCOUNT" ]; then
+ notify-send "display changed"
+ echo "displays changed"
if [ "$NEWDISPLAYCOUNT" -gt 1 ]; then
instantdisper
echo "multi monitor setup"
else
disper -e
fi
- echo "displays changed"
- notify-send "display changed"
DISPLAYCOUNT="$NEWDISPLAYCOUNT"
# todo: open menu
fi
Extend
PC screen only
Second screen only
- Duplicate
+ Duplicate
:g Set default action
:r Close menu' | instantmenu -l 20 -h -1 -w 400 -c -w -1 -bw 4 -q search
}
# apply saved setting
applydefault() {
if ! iconf automon; then
- echo "error applying default monitor setting"
+ echo "no default monitor setting"
fi
+
AUTOMON="$(iconf automon)"
if grep '^[esSc]$' <<<"$AUTOMON"; then
disper -"$AUTOMON"