aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/lid-switch-action7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/lid-switch-action b/bin/lid-switch-action
index 1a22015..4b91d48 100755
--- a/bin/lid-switch-action
+++ b/bin/lid-switch-action
@@ -1,8 +1,11 @@
#!/bin/bash
# What action to take on closing the laptop lid,
-# depending on whether a screen is attached or not
+# depending on whether a screen is attached or not.
+# This implies setting HandleLidSwitch=ignore in /etc/systemd/logind.conf
+# Call this script from /etc/acpi/handler.sh (or other properly set up script
+# for handling button/lid acpi event) with parameter 0 and 1 for close and open respectively
-# Check whether first parameter is a number
+# Check whether first parameter is a number
re='^[0-9]+$'
if ! [[ $1 =~ $re ]]; then
echo "error: Not a number" >&2; exit 1