
On Thu, Aug 2, 2012 at 12:29 PM, Bryan Huh
How do you get a list of visible workspaces (only those workspaces that are displayed on the monitors)? Currently I get the entire list of workspaces in my xmonad config with (XMonad.workspaces conf). It looks like this command returns a list of strings, each of which denote a workspace (i.e. ["1", "2"... ] ). But not sure how to get a list of only those which are visible (I could also probably work with a list of hidden workspaces).
This depends to some extent on how you plan to use it; for example, when passing that list to an outside program using ppVisible or ppOrder from XMonad.Hooks.DynamicLog may be more convenient than other mechanisms. The general case, however, is roughly along the lines of visibleWorkspaces :: X [WorkspaceId] visibleWorkspaces = do ws <- gets windowset return $ map W.tag $ W.current ws : W.visible ws Note that this is impure, so you can't simply drop it in place of (workspaces conf). If you give us more detail as to what you're trying to do, we can help you work it into your configuration properly. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms