scripts/mouse_detect.sh

18 lines
579 B
Bash
Raw Normal View History

2022-12-26 14:20:37 +01:00
#!/bin/sh
2024-12-25 21:14:35 +01:00
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
if riverctl list-inputs | grep -i 'mouse' | grep -i 'MOSART' >>/dev/null; then
2022-12-26 14:20:37 +01:00
riverctl input pointer-1267-12610-ELAN0515:01_04F3:3142_Touchpad events disabled
else
riverctl input pointer-1267-12610-ELAN0515:01_04F3:3142_Touchpad events enabled
fi
exit 0
else
2024-12-25 21:14:35 +01:00
if xinput list | grep -i 'mouse' | grep -i 'MOSART' >>/dev/null; then
exec $(xinput disable ELAN0515:01\ 04F3:3142\ Touchpad)
2022-12-26 14:20:37 +01:00
else
2024-12-25 21:14:35 +01:00
exec $(xinput enable ELAN0515:01\ 04F3:3142\ Touchpad)
2022-12-26 14:20:37 +01:00
fi
exit 0
fi