Add display toggle but protect against disabling the only active display

This commit is contained in:
David Heinemeier Hansson committed 2026-04-15 14:35:32 +02:00
1 parent f094c3acc0
commit 521c94bfca
2 files changed
+7

No files matched your search

@@ -17,6 +17,12 @@ if [[ $DISABLED == "true" ]]; then
hyprctl keyword monitor "$INTERNAL,preferred,auto,auto"
notify-send -u low "󰍹 Internal display on"
else
ACTIVE_COUNT=$(hyprctl monitors -j | jq 'length')
if [[ $ACTIVE_COUNT -le 1 ]]; then
notify-send -u low "󰍹 Can't disable the only active display"
exit 1
fi
hyprctl keyword monitor "$INTERNAL,disable"
notify-send -u low "󰍹 Internal display off"
fi