mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 03:26:13 +01:00
9 lines
380 B
Bash
9 lines
380 B
Bash
read TPdevice <<< $( xinput | sed -nre '/TouchPad|Touchpad/s/.*id=([0-9]*).*/\1/p' )
|
|
state=$( xinput list-props "$TPdevice" | grep "Device Enabled" | grep -o "[01]$" )
|
|
|
|
if [ "$state" -eq '1' ];then
|
|
xinput --disable "$TPdevice" && notify-send -i emblem-nowrite "Touchpad" "Disabled"
|
|
else
|
|
xinput --enable "$TPdevice" && notify-send -i emblem-nowrite "Touchpad" "Enabled"
|
|
fi
|