How to programmatically prevent linux computer from sleeping or turning on screensaver?
问题 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. In Windows, it can be done easily using SetThreadExecutionState function. In OS X, I think it can be done with UpdateSystemActivity but not tested yet. 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