You are not logged in.
Hi,
i'm writing a C utility. I'd like to know if there is a way for my utility to get "notified" when screen leaves blanked mode (DPMS) and returns active.
I'm currently using xcb to check if screen is blanked (ie, if dpms power_level is > "DPMSModeOn"). My purpose is to stop my utility while screen is off, and restart it as soon as screen becomes active.
Is this possible?
Thanks!
Last edited by nierro (2016-11-12 14:09:25)
Offline
X does not generate any events for DMPS mode changes. You could use inotify to watch for changes in the relevant path under /sys/class, but this may vary by hardware.
I suspect your best approach will just be to periodically poll the state for yourself.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
This explains why i could not find much informations about that...thanks!
As a future note: https://blog.martin-graesslin.com/blog/ … d-wayland/ . Here Martin says exatcly that.
It seems wayland does signal when changing dpms state indeed, so i can at least use that on wayland.
Again, thank you!
Offline