<div dir="ltr">On Thu, Aug 2, 2012 at 12:29 PM, Bryan Huh <span dir="ltr">&lt;<a href="mailto:bhh1988@gmail.com" target="_blank">bhh1988@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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. [&quot;1&quot;, &quot;2&quot;... ] ). 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).<br>
</blockquote><div><br></div><div>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.</div>
<div><br></div><div>The general case, however, is roughly along the lines of</div><div><br></div><div>    visibleWorkspaces :: X [WorkspaceId]</div><div>    visibleWorkspaces = do</div><div>      ws &lt;- gets windowset</div>
<div>      return $ map W.tag $ W.current ws : W.visible ws</div><div><br></div><div>Note that this is impure, so you can&#39;t simply drop it in place of (workspaces conf).  If you give us more detail as to what you&#39;re trying to do, we can help you work it into your configuration properly.</div>
<div><br></div></div>-- <br>brandon s allbery                                      <a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a><br>wandering unix systems administrator (available)     (412) 475-9364 vm/sms<br>
<br>
</div>