From 00670960f7ca8f56fc60623571137826a1893839 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 30 Sep 2023 17:24:03 +1000 Subject: [acpid] Add config/scripts to toggle touchpad on laptop lid events --- misc-root/etc/acpi/actions/lid.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 misc-root/etc/acpi/actions/lid.sh (limited to 'misc-root/etc/acpi/actions/lid.sh') diff --git a/misc-root/etc/acpi/actions/lid.sh b/misc-root/etc/acpi/actions/lid.sh new file mode 100755 index 0000000..6bf2c59 --- /dev/null +++ b/misc-root/etc/acpi/actions/lid.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# Turn off/on touchpad when lid is closed/open +# Guess the touchpad name +touch_name=$(DISPLAY=:0 xinput list --name-only | grep -i touchpad) +case "$3" in + close) + DISPLAY=:0 xinput set-prop "$touch_name" "Device Enabled" 0 && + logger "Touchpad disabled" + ;; + open) + DISPLAY=:0 xinput set-prop "$touch_name" "Device Enabled" 1 && + logger "Touchpad enabled" + ;; + *) + logger "ACPI action undefined: $3" + ;; +esac -- cgit v1.2.3