From 84c4b12b9b57c82171129b9893eb72ba690fddad Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sun, 20 Aug 2023 17:28:54 -0500 Subject: [PATCH] feat(hypr): add event monitor for laptop lid --- .../hypr/scripts/launchers/events-monitor.bash | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dots/.config/hypr/scripts/launchers/events-monitor.bash b/dots/.config/hypr/scripts/launchers/events-monitor.bash index 92540cc5..3f4544ea 100755 --- a/dots/.config/hypr/scripts/launchers/events-monitor.bash +++ b/dots/.config/hypr/scripts/launchers/events-monitor.bash @@ -30,5 +30,23 @@ monitor-ssid() { done } +monitor-laptop-lid() { + local laptop_lid_state + while :; do + laptop_lid_state="$(/dev/null; then + hyprctl keyword monitor "eDP-1, disable" >/dev/null && printf "Disabled laptop screen as the laptop was shut\n" + fi + ;; + esac + sleep 1 + done +} + monitor-ssid & +monitor-laptop-lid & wait