[xmonad] list of visible workspaces

Bryan Huh bhh1988 at gmail.com
Thu Aug 2 20:20:39 CEST 2012

I'm sorry if this is a stupid question, but the xmonad.hs doesn't 
compile saying that "when" is out of scope. It seems to not recognize 
the keyword "when." I tried "if" as well but then it tells me there's a 
parse error. Are you sure that what you have compiles for you?

On 08/02/2012 11:03 AM, Brandon Allbery wrote:
> On Thu, Aug 2, 2012 at 1:19 PM, Bryan Huh <bhh1988 at gmail.com 
> <mailto:bhh1988 at gmail.com>> wrote:
>     What I'm trying to do is prevent my focus from switching to a
>     different screen if I mistakenly try to switch to an already
>     visible workspace. I already am not using greedyView so I don't
>     have the problem of the visible workspaces swapping on me. But
>     suppose I have two screens and workspace 1 is on the left,
>     workspace 2 is on the right. If I'm focused on the left screen,
>     and I were to press mod-2, the focus switches to the screen on the
>     right. If I now press mod-3 it will be the right screen which
>     switches to workspace 3. This annoys me, because it effectively
>     prevents me from cycling through workspaces on one screen.
>     Greedyview I think would not have this issue, but the screen
>     swapping confuses me. What I want is, when I'm on the left screen
>     and I press mod-2, which is an already visible workspace, nothing
>     should happen. No swapping of screens, and no moving of focus.
> viewHidden :: WorkspaceId -> X ()
>   viewHidden w = do
>     ws <- gets windowset
>     when (w `notElem` (map W.tag $ W.current ws : W.visible ws)) 
> (W.view w)
>        [((m .|. modm, k), windows $ f i)
>             | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
>             , (f, m) <- [(viewHidden, 0), (W.shift, shiftMask)]
> It's not quite as simple as you'd hoped, because of the whole purity 
> thing; "workspaces conf" doesn't change, but whether a workspace is 
> visible or not is dynamic and special care needs to be taken with it.
> -- 
> brandon s allbery allbery.b at gmail.com <mailto:allbery.b at gmail.com>
> wandering unix systems administrator (available)     (412) 475-9364 vm/sms

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20120802/b4b73e03/attachment-0001.htm>

More information about the xmonad mailing list