Re: [arch-general] Script to check monitor blank state

2010-05-26 Thread Markus
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


Re: [arch-general] Script to check monitor blank state

2010-05-25 Thread Jérôme M. Berger
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:jeber...@free.fr
http://jeberger.free.fr
Jabber: jeber...@jabber.fr



signature.asc
Description: OpenPGP digital signature


Re: [arch-general] Script to check monitor blank state

2010-05-24 Thread Aaron Griffin
On Mon, May 24, 2010 at 8:36 AM, 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?
>
> 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


Re: [arch-general] Script to check monitor blank state

2010-05-24 Thread Alexander Lam
On Mon, May 24, 2010 at 9:36 AM, 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?
>
> 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