[Xmonad] Show name of focused window in status bar
Lukas Mai
l.mai at web.de
Tue Aug 21 12:09:45 EDT 2007
Am Dienstag, 21. August 2007 schrieb Kai Grossjohann:
> Do people think that showing the name of the currently focused window in
> the status bar (in addition to the workspaces) would be a worthwhile
> addition?
>
> If so, could you advise how to improve the quality of the code I've
> concocted? Given that I don't know Haskell, I'm happy that it runs.
>
> Here's what I did.
>
> To NamedWindows.hs I added the following function (and exported it):
>
> unWindow :: NamedWindow -> String
> unWindow (NW n _) = n
That function already exists; it's called "show".
My Config.hs says:
logHook = withWindowSet $ \ws -> do
let d = pprWindowSet ws
t <- maybe (return "") (liftM show . getName) (W.peek ws)
io . putStrLn $ show t ++ d
HTH, Lukas
More information about the Xmonad
mailing list