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

9 lines
425 B
Bash
Executable File

#!/bin/sh
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
xinput --disable "$TPdevice" && notify-send -h string:x-dunst-stack-tag:"togtp" "Touchpad Disabled" -i input-touchpad-off
else
xinput --enable "$TPdevice" && notify-send -h string:x-dunst-stack-tag:"togtp" "Touchpad Enabled" -i input-touchpad-on
fi