[arch-general] Script to check monitor blank state
Hello everyone, i would like to write a little script, that suspends my computer if a few circumstances are met. One should be, that my screen should be blanked. I already did a google search on this, but i only found howtos of getting it to work / disable it. It looks like xset q does not print the actual state. Maybe there is a hook for screen blanking? I know this is not a arch specific question, but maybe someone can help me. Markus
On Mon, May 24, 2010 at 9:36 AM, Markus <markus@hackfleischeis.de> wrote:
Hello everyone,
i would like to write a little script, that suspends my computer if a few circumstances are met.
One should be, that my screen should be blanked. I already did a google search on this, but i only found howtos of getting it to work / disable it.
It looks like xset q does not print the actual state. Maybe there is a hook for screen blanking?
I know this is not a arch specific question, but maybe someone can help me.
Markus
I don't actually have a script for this, although I may end up writing one because I want similar functionality (just after xx minutes, suspend, not on screen blank). But, what you can do is install xscreensaver. xscreensaver-command -watch can be used to monitor the screen saver state (which may be just blank your desktop) and thus control the script. -- Alexander Lam
On Mon, May 24, 2010 at 8:36 AM, Markus <markus@hackfleischeis.de> wrote:
Hello everyone,
i would like to write a little script, that suspends my computer if a few circumstances are met.
One should be, that my screen should be blanked. I already did a google search on this, but i only found howtos of getting it to work / disable it.
It looks like xset q does not print the actual state. Maybe there is a hook for screen blanking?
I know this is not a arch specific question, but maybe someone can help me.
If this is X specific, you might want to drop to the C level - write an app that uses a normal Xlib event loop, and catches all input events (keyboard and mouse events). After a given timeout with no input events, do your blanking / suspend
Markus wrote:
Hello everyone,
i would like to write a little script, that suspends my computer if a few circumstances are met.
One should be, that my screen should be blanked. I already did a google search on this, but i only found howtos of getting it to work / disable it.
It looks like xset q does not print the actual state. Maybe there is a hook for screen blanking?
Here, "xset q" has a line that says: "Monitor is On". Couldn't you use that? Jerome -- mailto:jeberger@free.fr http://jeberger.free.fr Jabber: jeberger@jabber.fr
On 25.05.2010 19:17, "Jérôme M. Berger" wrote:
Here, "xset q" has a line that says: "Monitor is On". Couldn't you use that?
Jerome
Yes this seems actually very useful, i had dpms inactive, but ScreenSaver blanking on. Maybe someone knows what the difference between these two is all about. It looks totally equal from the "outside" ;-) Now that I activated dpms, there is this line indicating the state. xset q | awk '{if (match($0,"Monitor is On")) {print "notblanked"}}' I am going to use this little check for my script. Thank you for your help! Markus
participants (4)
-
"Jérôme M. Berger"
-
Aaron Griffin
-
Alexander Lam
-
Markus