netbrain / zwift

Easily zwift on linux
The Unlicense
230 stars 27 forks source link

feat: inhibit screensaver #105

Closed perrin4869 closed 3 months ago

perrin4869 commented 3 months ago

since running zwift doesn't require any keyboard/mouse input, the screensaver/screen lock, etc may be triggered in the middle. afaik, the standard for inhibiting the screensaver is to periodically call the dbus service org.freedesktop.ScreenSaver with the Inhibit method, for example, with xscreensaver This is what Firefox does. The easiest way to achieve this, is to use xdg-screensaver reset from the xdg-utils package. I've been running this separately in another terminal each time I start zwift, but I think it's a good idea to add support for it for anyone who's running a dbus server.

Edit: lutris may have done something similar: https://github.com/lutris/lutris/issues/2424#issuecomment-609976923

perrin4869 commented 3 months ago

hm... well, as it is, it is completely transparent from the user perspective, so I'm not sure what I would mention in the readme, other than to add a paragraph introducing this feature?

netbrain commented 3 months ago

Maybe just mention that every 30 seconds x screensaver is inhibited on the host machine if the env variable is defined.