summaryrefslogtreecommitdiff
path: root/.scripts/toggle_touchpad.sh
blob: 64c018b5c7a0b3fce94374e537989a2bab5397fe (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash

exec synclient TouchpadOff=$((1-$(synclient | awk '/TouchpadOff/ { print $3 }')))

device_id=$(xinput list | sed -n "s/^.*Synaptics.*id=\([^\t]*\).*$/\\1/p")

enabled=$(xinput list-props $device_id | sed -n "s/^.*Device Enabled.*\t\(.*\)$/\\1/p")
property=$(xinput list-props $device_id | sed -n "s/^.*Device Enabled (\([^)]*\)).*$/\\1/p")


xinput set-prop $device_id $property $((1-enabled))