0

I'd like to write a program on Linux / X11, that just displays some photos for several seconds. It displays one photo at a time, waits some seconds and then displays the next.

The whole program would be pointless if the screen saver or any power management would kick in.

I would expect there is any API / function call to achieve this, but I did not find any. From other programs I know that what I want is achievable: If I watch a long clip on YouTube, no screen saver comes in, if I pause the video, the screen saver gets activated after some time.

How can I disable any screen saver AND any power management related switch off of the monitor I use?

Is there any API in X11 or anywhere else for this? Would I need to emit fake keyboard presses?

Thanks for any hints.

Torsten Mohr
  • 489
  • 6
  • 16
  • API? We don't need no stinkin' API. Real men use command line interface. For controlling screen power management and/or screensaver, we use [`xset (1)`](https://linux.die.net/man/1/xset), unless you happen to run [`xscreensaver (1)`](https://www.jwz.org/xscreensaver/man1.html), which overrides `xset` settings, so you need to muck with `xscreensaver` settings. I cannot vouch for other attempts of reinventing the wheel. But perhaps [this](https://stackoverflow.com/questions/31498114/how-to-programmatically-prevent-linux-computer-from-sleeping-or-turning-on-scree) is what you are looking for? – n. m. could be an AI Dec 26 '21 at 12:42
  • Also [this](https://stackoverflow.com/questions/9369502/how-to-heartbeat-x11-screensaver) and [this](https://stackoverflow.com/questions/460140/is-there-a-decent-way-to-inhibit-screensavers-in-linux) – n. m. could be an AI Dec 26 '21 at 12:51

0 Answers0