Add display toggle but protect against disabling the only active display
This commit is contained in:
@@ -17,6 +17,12 @@ if [[ $DISABLED == "true" ]]; then
|
|||||||
hyprctl keyword monitor "$INTERNAL,preferred,auto,auto"
|
hyprctl keyword monitor "$INTERNAL,preferred,auto,auto"
|
||||||
notify-send -u low " Internal display on"
|
notify-send -u low " Internal display on"
|
||||||
else
|
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"
|
hyprctl keyword monitor "$INTERNAL,disable"
|
||||||
notify-send -u low " Internal display off"
|
notify-send -u low " Internal display off"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ bindd = SUPER SHIFT ALT, COMMA, Restore last notification, exec, makoctl restore
|
|||||||
# Toggles
|
# Toggles
|
||||||
bindd = SUPER CTRL, I, Toggle locking on idle, exec, omarchy-toggle-idle
|
bindd = SUPER CTRL, I, Toggle locking on idle, exec, omarchy-toggle-idle
|
||||||
bindd = SUPER CTRL, N, Toggle nightlight, exec, omarchy-toggle-nightlight
|
bindd = SUPER CTRL, N, Toggle nightlight, exec, omarchy-toggle-nightlight
|
||||||
|
bindd = SUPER CTRL, Delete, Toggle laptop display, exec, omarchy-hyprland-monitor-internal-toggle
|
||||||
|
|
||||||
# Control Apple Display brightness
|
# Control Apple Display brightness
|
||||||
bindd = CTRL, F1, Apple Display brightness down, exec, omarchy-brightness-display-apple -5000
|
bindd = CTRL, F1, Apple Display brightness down, exec, omarchy-brightness-display-apple -5000
|
||||||
|
|||||||
Reference in New Issue
Block a user