[xmonad] No ppCurrentNoWindows in XMonad.Hooks.DynamicLog

Brent Yorgey byorgey at seas.upenn.edu
Sun Sep 25 17:52:18 CEST 2011


On Sun, Sep 25, 2011 at 04:59:52PM +0200, Bastien Dejean wrote:
> Hi,
> 
> I was trying to replicate dwm status bar and I realised it was not
> possible: there's no way to differentiate between a focused workspace
> which contain windows and one that doesn't.

It's true, there isn't.  I have never heard anyone ask for this
before; surely you can tell whether or not there are any windows on
the focused workspace without looking at your status bar! =)

I don't think it's worth adding a ppCurrentNoWindows field.  However,
thinking at a bit higher level, the current zoo of ppBlah fields for
formatting workspace names is ad-hoc and silly.  Ideally we could
instead have just *one* field which specifies how to format workspace
names, with the type

  ppWorkspaces :: [WorkspaceId -> Maybe String]

The idea is that each workspace would be formatted according to the
first function in the list that returned a Just value.  This way users
could slice and dice the formatting of their workspaces however they
like.

It wouldn't be backwards compatible, but of course we could supply
functions like isUrgent, isCurrent, isVisible, etc. which do the
checks currently hardcoded into pprWindowSet, so there is an obvious
upgrade path. If you used to have

  ...
  ppVisible = foo
  ...

you will now have

  ppWorkspaces = [ ...
                 , isVisible ?> foo
                 , ...
                 ]

where (p ?> f) x = if p x then Just (f p) else Nothing.

Just an idea.  I don't have time to do it myself.  But it could make a
for a fun little project for anyone looking to do some xmonad hacking.

-Brent



More information about the xmonad mailing list