I have one machine which repeatedly wakes its display at night. My assumption is that this is due to spurious movement from the mouse.

There is not an explicit way to configure Linux (X11) so that it doesn't exit DPMS sleeps on mouse movement, but I found a tip on the internet to disable the mouse device at the XInput level when activating the screensaver, and reactivating it when the screensaver exits.

I don't run a "screensaver application" so wiring into things like dbus for notification doesn't work. Instead, I wrote an X program which polls the requested DPMS state and enables or disables the mouse device accordingly.

It remains to be seen whether this solves the problem which causes the display to turn on multiple times per night, but it might just fix it.

You'll need to customize the program by changing the "device_name" string in the source to match your own input device. If you have multiple input devices, then more extensive work will be required.

License: GPL v3+

Files currently attached to this page: