mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-11 09:22:02 +01:00
8 lines
380 B
Bash
8 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
|