[Xmonad] Re: darcs patch: make spawn redirect std* to /dev/null

Toby Allsopp toby at mi6.gen.nz
Mon Sep 24 06:21:47 EDT 2007


Spencer Janssen writes:

> The consensus seems to be that we should fix logHook rather than changing
> spawn.

Attached is a module providing a log hook that starts its own dzen.
This is very kludgy but shows that it can be achieved.  Use it by
putting in Config.hs:

import XMonadContrib.StatusBar

logHook = statusBar defaultSBConf

This log hook includes window titles, but in order for them to be
updated properly Main.hs need to be hacked to call logHook on
XPropertyNotify events.  I achieve this with:

hunk ./Main.hs 254
-handle e = broadcastMessage e -- trace (eventName e) -- ignoring
+handle e = do
+  case e of
+    (AnyEvent {ev_event_type = t})
+        | t == propertyNotify -> updateProperties
+    _ -> return ()
+  broadcastMessage e -- trace (eventName e) -- ignoring
hunk ./Operations.hs 253
+
+updateProperties :: X ()
+updateProperties = logHook

I hope this is of some inspiration to others.

Toby.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: StatusBar.hs
Type: text/x-haskell
Size: 5273 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/xmonad/attachments/20070924/b350c7dc/StatusBar.bin


More information about the Xmonad mailing list