[xmonad] Fwd: 'resetScreenSaver' from 'Graphics.X11.Xlib.Misc'

Dontdie YCH dontdieych at gmail.com
Thu Jan 22 18:34:14 UTC 2015


---------- Forwarded message ----------
From: Dontdie YCH <dontdieych at gmail.com>
Date: Fri, Jan 23, 2015 at 3:33 AM
Subject: Re: [xmonad] 'resetScreenSaver' from 'Graphics.X11.Xlib.Misc'
To: Brandon Allbery <allbery.b at gmail.com>


I had same idea about that so I tried as I already showed.

Set screensaver timer to 10 sec then call resetScreenSaver every 5
sec. If this is right, screensaver should not appeared. But It was.

resetScreenSaver.hs :

~~~
import Graphics.X11.Xlib
import Graphics.X11.Xlib.Misc
import Control.Concurrent
import Control.Monad

main = do
    dpy <- openDisplay ""
    forever $ do
        putStrLn "reset"
        resetScreenSaver dpy
        threadDelay (5*1000000)
~~~


~~~
$ xset s 10
$ runhaskell resetScreenSaver.hs
~~~

On Wed, Jan 21, 2015 at 10:14 PM, Brandon Allbery <allbery.b at gmail.com> wrote:
> On Wed, Jan 21, 2015 at 1:22 AM, Dontdie YCH <dontdieych at gmail.com> wrote:
>>
>> But it does not working. I didn't know how I directly deal with X11
>> lib. Fortunately, I found 'resetScreenSaver' from
>> 'Graphics.X11.Xlib.Misc' that say interface to XResetScreenSaver().
>
>
> resetScreenSaver is a one-shot operation that turns off any currently
> running screen saver by resetting the no-activity timer. If you want to keep
> the screen saver off, you need a thread that periodically calls
> resetScreenSaver, perhaps once every 30 seconds.
>
> --
> brandon s allbery kf8nh                               sine nomine associates
> allbery.b at gmail.com                                  ballbery at sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net


More information about the xmonad mailing list