update togtp script
This commit is contained in:
parent
57057427b2
commit
592bf60a63
1 changed files with 18 additions and 5 deletions
|
@ -2,13 +2,26 @@
|
||||||
|
|
||||||
TPdevice=$(xinput | sed -nre '/TouchPad|Touchpad/s/.*id=([0-9]*).*/\1/p')
|
TPdevice=$(xinput | sed -nre '/TouchPad|Touchpad/s/.*id=([0-9]*).*/\1/p')
|
||||||
|
|
||||||
alias off=xinput --disable "$TPdevice" && notify-send -h string:x-dunst-stack-tag:"togtp" "Touchpad Disabled" -i input-touchpad-off
|
off() {
|
||||||
alias on=xinput --enable "$TPdevice" && notify-send -h string:x-dunst-stack-tag:"togtp" "Touchpad Enabled" -i input-touchpad-on
|
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" = "-n" ] && {
|
||||||
|
off
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
[ "$1" = "-y" ] && { on; exit; }
|
[ "$1" = "-y" ] && {
|
||||||
|
on
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
xinput list-props "$TPdevice" | grep -oPq "Device Enabled \(\d*\):\s*1" && { off; exit; }
|
xinput list-props "$TPdevice" | grep -oPq "Device Enabled \(\d*\):\s*1" && {
|
||||||
|
off
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
on
|
on
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue