dotfiles/home-manager/modules/xmonad/scripts/toggle-touchpad.sh
MagicRB 05d186d304
Redo xmonad config, allows for new packages and LSP
Signed-off-by: MagicRB <richard@brezak.sk>
2023-10-03 16:54:07 +02:00

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