28 lines
532 B
Bash
Executable File
28 lines
532 B
Bash
Executable File
#!/bin/sh
|
|
|
|
TPdevice=$(xinput | sed -nre '/TouchPad|Touchpad/s/.*id=([0-9]*).*/\1/p')
|
|
|
|
off() {
|
|
xinput disable "$TPdevice" && notify-send -h string:x-dunst-stack-tag:"togtp" "Touchpad Disabled" -i input-touchpad-off
|
|
}
|
|
on() {
|
|
xinput enable "$TPdevice" && notify-send -h string:x-dunst-stack-tag:"togtp" "Touchpad Enabled" -i input-touchpad-on
|
|
}
|
|
|
|
[ "$1" = "-n" ] && {
|
|
off
|
|
exit
|
|
}
|
|
|
|
[ "$1" = "-y" ] && {
|
|
on
|
|
exit
|
|
}
|
|
|
|
xinput list-props "$TPdevice" | grep -oPq "Device Enabled \(\d*\):\s*1" && {
|
|
off
|
|
exit
|
|
}
|
|
|
|
on
|