diff options
Diffstat (limited to 'config/hypr')
| -rw-r--r-- | config/hypr/UserConfigs/Laptops.conf | 4 | ||||
| -rwxr-xr-x | config/hypr/scripts/LidSwitch.sh | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/config/hypr/UserConfigs/Laptops.conf b/config/hypr/UserConfigs/Laptops.conf index fefc0d80..4fac8a5d 100644 --- a/config/hypr/UserConfigs/Laptops.conf +++ b/config/hypr/UserConfigs/Laptops.conf @@ -15,8 +15,8 @@ $UserConfigs = $HOME/.config/hypr/UserConfigs # Suggest you edit below for your laptop display # From WIKI This is to disable laptop monitor when lid is closed. # consult https://wiki.hyprland.org/hyprland-wiki/pages/Configuring/Binds/#switches -bindl = , switch:off:Lid Switch,exec,hyprctl keyword monitor "eDP-1, preferred, auto, 1" -bindl = , switch:on:Lid Switch,exec,hyprctl keyword monitor "eDP-1, disable" +bindl = , switch:off:Lid Switch, exec, $HOME/.config/hypr/scripts/LidSwitch.sh open +bindl = , switch:on:Lid Switch, exec, $HOME/.config/hypr/scripts/LidSwitch.sh close # WARNING! Using this method has some caveats!! USE THIS PART WITH SOME CAUTION! diff --git a/config/hypr/scripts/LidSwitch.sh b/config/hypr/scripts/LidSwitch.sh new file mode 100755 index 00000000..2a3fc3eb --- /dev/null +++ b/config/hypr/scripts/LidSwitch.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) - Laptop Lid Switch Handler +# ================================================== + +ACTION="${1:-check}" +LOGFILE="/tmp/hypr_lid.log" + +echo "$(date '+%Y-%m-%d %H:%M:%S') - Lid event triggered: $ACTION" >> "$LOGFILE" + +if [ "$ACTION" = "close" ]; then + hyprctl keyword monitor "eDP-1, disable" >> "$LOGFILE" 2>&1 +elif [ "$ACTION" = "open" ]; then + hyprctl keyword monitor "eDP-1, preferred, auto, 1" >> "$LOGFILE" 2>&1 +fi |
