updated dots
This commit is contained in:
18
hypr/scripts/lid_handler.sh
Executable file
18
hypr/scripts/lid_handler.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# ~/.config/hypr/scripts/lid_handler.sh
|
||||
|
||||
if [[ "$1" == "close" ]]; then
|
||||
# Lid closed: disable laptop screen if any DP-* monitor is present
|
||||
# Using 'all' to detect monitors even if they are currently disabled
|
||||
if hyprctl monitors all | grep -q "Monitor DP-"; then
|
||||
hyprctl keyword monitor "eDP-1, disable" # Disable laptop display
|
||||
|
||||
# Enable all detected DP-* monitors
|
||||
for monitor in $(hyprctl monitors all | grep "Monitor DP-" | awk '{print $2}'); do
|
||||
hyprctl keyword monitor "$monitor, enable"
|
||||
done
|
||||
fi
|
||||
elif [[ "$1" == "open" ]]; then
|
||||
# Lid opened: re-enable laptop screen
|
||||
hyprctl keyword monitor "eDP-1, enable"
|
||||
fi
|
||||
Reference in New Issue
Block a user