2

I prefer not having my monitor on at all times (or shutting down manually by pressing its hardware key) and thus the 'screen blank' option* is enabled (Gnome's 'power' settings). Any input wakes the display.

The laser mice I've owned pick subwoofer vibrations (the loudspeaker is placed under my computer table), for instance, and I tend to "flip" the rodent over several times a day to prevent the device from registering movement. Otherwise my display may never shut down automatically while music is playing. I've even considered switching to another type of pointing device (perhaps a joystick or some gamepad).

The question is specifically about Wayland — this one is about Xorg. Stock Gnome (44 at the time), GDM.


*'turns the screen off after a period of inactivity'

1 Answers1

0

You can configure "xlock" to disable your mouse a few seconds before entering standby and reenable it when you press a key and come out of standby.

For example:

First use xinput list to get the device ID for your mouse, and then use

xinput --set-prop [ID#] "Device Enabled" "0"

and

xinput --set-prop [ID#] "Device Enabled" "1" to disable and enable the mouse.

I've just tested these by disabling the mouse and then calling xset dpms force standby. Waving the mouse around for several seconds did nothing to disturb the screen, but pressing a single key worked fine. Using the second command then returned the mouse back to normal, including the "constant deceleration" setting that my default startup scripts set for me.

Next you should be able to pass these two commands to the -startCmd and -endCmd options to xlock to get what you're after.

xlock -startCmd 'xinput --set-prop [ID#] "Device Enabled" "0"' -endCmd 'xinput --set-prop [ID#] "Device Enabled" "1"' -mode blank -echokeys -timeelapsed +usefirst