From c2b8a0b8fe0f082040d474b17011d4fde158edf1 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 12 Oct 2020 14:29:06 +0200 Subject: [PATCH] toggle synaptics touchpad --- toggle-touchpad.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 toggle-touchpad.sh diff --git a/toggle-touchpad.sh b/toggle-touchpad.sh new file mode 100755 index 0000000..cb2cf9a --- /dev/null +++ b/toggle-touchpad.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +declare -i ID +ID=`xinput list | grep -Eio '(touchpad|glidepoint)\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'` +declare -i STATE +STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'` +if [ $STATE -eq 1 ] +then + xinput disable $ID + # echo "Touchpad disabled." + # notify-send -a 'Touchpad' 'Disabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png +else + xinput enable $ID + # echo "Touchpad enabled." + # notify-send -a 'Touchpad' 'Enabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png +fi