handle disconnected monitors

This commit is contained in:
tavo-wasd 2024-08-25 13:58:31 -06:00
parent 115b3c31f8
commit 54a782f4d1

View file

@ -1,8 +1,9 @@
#!/bin/sh
LIST="$(xrandr | sed '/ connected/!d;s/ .*$//')"
MONITORS="$(printf '%s' "${LIST}" | tr '\n' ' ')"
MIRR="$(printf 'Yes\nNo' | menu "Mirror monitors?:")"
ULIST="$(xrandr | sed '/ disconnected/!d;s/ .*$//')"
MONITORS="$(printf '%s' "${LIST}" | tr '\n' ' ')"
MIRR="$(printf 'Yes\nNo' | menu "Mirror monitors?:")"
for i in ${ULIST} ; do
UNSET="${UNSET} --output ${i} --off"