From 717fdadf3a84f5e2793797cb72a9e834ee6d5f25 Mon Sep 17 00:00:00 2001 From: Alex R Date: Sat, 17 Jun 2023 22:41:05 -0500 Subject: [PATCH] check for acpi before getting lid state --- .config/sway/scripts/clamshell.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.config/sway/scripts/clamshell.sh b/.config/sway/scripts/clamshell.sh index 3445910..e25072a 100644 --- a/.config/sway/scripts/clamshell.sh +++ b/.config/sway/scripts/clamshell.sh @@ -1,6 +1,8 @@ #!/usr/bin/bash -if cat /proc/acpi/button/lid/*/state | grep -q open; then - swaymsg output eDP-1 enable -else - swaymsg output eDP-1 disable +if [-d "/proc/acpi" ]; then + if cat /proc/acpi/button/lid/*/state | grep -q open; then + swaymsg output eDP-1 enable + else + swaymsg output eDP-1 disable + fi fi