From 54a782f4d1d3647a0c3579234738a6c5fd516492 Mon Sep 17 00:00:00 2001 From: tavo-wasd Date: Sun, 25 Aug 2024 13:58:31 -0600 Subject: [PATCH] handle disconnected monitors --- scripts/menu/menu-xrandr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/menu/menu-xrandr b/scripts/menu/menu-xrandr index 24b473b..a00d406 100755 --- a/scripts/menu/menu-xrandr +++ b/scripts/menu/menu-xrandr @@ -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"