1
0
Fork 0
dotfiles/.local/bin/togtp

9 lines
417 B
Plaintext
Raw Normal View History

#!/bin/sh
2024-01-02 19:09:46 +01:00
TPdevice=$(xinput | sed -nre '/TouchPad|Touchpad/s/.*id=([0-9]*).*/\1/p')
if xinput list-props "$TPdevice" | grep -oPq "Device Enabled \(\d*\):\s*1"; then
2024-01-02 19:09:46 +01:00
xinput --disable "$TPdevice" && notify-send -h string:x-dunst-stack-tag:"togtp" "Touchpad Disabled" -i input-touchpad-off
else
2024-01-02 19:09:46 +01:00
xinput --enable "$TPdevice" && notify-send -h string:x-dunst-stack-tag:"togtp" "Touchpad Enabled" -i input-touchpad-on
fi