While developing a small cross-platform game on C++, I got stuck with following issue: when players are playing with a USB gamepad without touching a keyboard or mouse, the computer sleeps automatically while they're playing.
But the problem is, in Linux there's nothing like a common API between DE's. I've found that in Gnome you can stop the auto-suspending by using DBus calls
Uninhibit(), but it works only for Gnome.
So, is there exists a programatically cross-DE way (or non-DE way, for example if user is using something like
awesome wm) to prevent a Linux system (using Xorg and without root access of course) from sleeping or turning on screensaver without changing user configuration files?
PS: Don't think that it's too complicated, but don't know how unfortunately.
From a quick look at how mplayer and SDL do it, there are two things you can do to prevent the screensaver from firing up: