[xmonad] Re: darcs patch: U.Loggers: add maildirNew, other loggers, and logger f...

Brent Yorgey byorgey at seas.upenn.edu
Wed Jun 3 23:08:48 EDT 2009

On Wed, Jun 03, 2009 at 10:32:35PM -0400, Brent Yorgey wrote:
> On Wed, Jun 03, 2009 at 02:27:42PM -0400, Sean McEligot wrote:
> >
> > I thought it was nice to run the status bar internally. I prefer using 
> > Haskell to shell scripts and internal status information would be available 
> > that otherwise would not. The one drawback is I was unable to find a way to 
> > refresh at regular intervals. So, for example, A clock wouldn't be updated 
> > until the user switched windows.
> Yup, this is a definite drawback.  The problem, of course, is that the logHook
> only runs when xmonad's status changes.
> Actually, I wonder if we could use the new eventHandlerHook (or
> whatever it's called) to run the logHook at regular intervals (it
> shouldn't hurt to run the logHook *more* often).  We just need some
> external process to generate synthetic X events of some sort.  Anyone
> know how to do that

I answered my own question.  In fact, it was even easier than I
thought; it didn't involve the eventHook at all.  I just made a new
keybinding which runs the logHook, and then wrote a little script
which uses xdotool to generate the key combination in question every
ten seconds.  A bit of a hack, perhaps, but so far it seems to work
pretty well.

...actually, I take that back, it's not quite as nice as you might
like, since if I happen to be holding down another modifier key at the
time that the key event gets generated, weird things happen.  And
sometimes when I'm typing I'll lose a keystroke, presumably if I type
something at the same time as the generated event.  Weird, there has
to be a better way to do this.


More information about the xmonad mailing list