From 690efe35a852fdc625a74f4bb23b9836eb422f2f Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Mon, 7 Mar 2016 11:57:25 +0100 Subject: Add touchpad control script --- touchpad.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 touchpad.sh diff --git a/touchpad.sh b/touchpad.sh new file mode 100755 index 0000000..9bb6f6f --- /dev/null +++ b/touchpad.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env sh + +case $1 in + "enable") + ACTION="enable" + ;; + "disable") + ACTION="disable" + ;; + *) + echo "Invalid action." + echo "Usage: $0 enable|disable" + exit + ;; +esac + +DEVICES=$(xinput list --name-only | grep -i touchpad) + +if [ -z "$DEVICES" ]; then + echo "No touchpad found." + exit +fi + +IFS=' +' + +for DEVICE in $DEVICES; do + xinput "$ACTION" "$DEVICE" +done + -- cgit v1.2.3