#!/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