[Xmonad] Show windows in status bar?

Donald Bruce Stewart dons at cse.unsw.edu.au
Mon Jun 11 05:54:47 EDT 2007


kai.grossjohann:
> What I like about dwm is that it shows me the title of the currently
> focussed window in the status bar.  Has anyone done this for xmonad?

Should be very easy now with the logHook system. Use
XMonadContrib.NamedWindows. Find the focused window on each workspace
(using peek), and find its name with show =<< getName

> Furthermore, it would be cool to get some indication of other windows on
> the current workspace: One could display a list of titles and highlight
> the currently focussed window.  The difficult part is that the list of
> titles is likely long, so one would have to shorten it somehow.
> 
> List of titles:
> 
> Emacs / xterm 1 / [xterm 2] / Gaim / xload
> 
> Here, xterm 2 would be the current window.
> 
> Shortening the list of titles:
> 
>   - Truncate title of current window to 20 (configurable)
>   - Truncate titles of other windows to 10 each (configurable)
>   - Only print windows around the currently focussed one.
>   - Use ellipsis to show truncations
> 
>     ... / xt... / [xter...] / Ga... / ...
>     ^^^   ^^^^^    ^^^^^^^    ^^^^^   ^^^
>      |      |         |         |     Windows omitted from rear
>      |      |                   | 
>      |      Truncated titles of nonactive windows
>      |
>      Windows omitted from front
>                       
>                       |
>                       Truncated title of active window
> 
> Thoughts?  Opinions?
> 

Nicely thoughout idea.

I think this would make a very nice contrib module. To get an idea of
how to write log hooks, look at DynamicLog.hs

-- Don


More information about the Xmonad mailing list