[xmonad] Cycle through all visible windows

Alex Su alexsu04 at gmail.com
Thu Feb 23 20:14:46 UTC 2017


Thanks for the response!

Cycling through workspaces and then cycling focus isn't exactly what I was
looking for, neither is GridSelect. Ideally, the behavior would be just be
to move the currently focused window to the next window on any visible
screen and cycle through (changing workspaces as necessary), whereas right
now Alt-Tab is limited to cycling focus through windows on the focused
workspace. There wouldn't be any screen swapping, just basically being able
to Alt-Tab across the two physical screens that I have.

On Thu, Feb 23, 2017 at 1:49 PM, Linus Arver <linusarver at gmail.com> wrote:

> On Thu, Feb 23, 2017 at 09:19:18AM -0600, alexsu04 at gmail.com wrote:
> >
> > Hi all,
> >
> > I’ve been trying to get XMonad set up for dual monitor, but have been
> struggling with finding a way to cycle focus through every window (not
> workspace) visible on either screen. The behavior would be similar to
> XMonad.Actions.WindowNavigation (the experimental module), but the
> cycling wouldn’t be bound to any direction, just cycle through all visible
> windows in the normal Alt-Tab sequence (left to right, top to bottom).
> >
> > I’ve found some code in a previous thread that supposedly manipulates
> the StackSet, but it didn’t work for me:
> >
> > > -- top of config
> > > import qualified XMonad.StackSet as W
> >
> > > -- somewhere at top level
> > > onAllWS f = windows $ \ws at W.StackSet{ W.current = c, W.visible = vs }
> ->
> > >    let screenNext x = W.current . f $ ws { W.current = x }
> > >        c':vs' = map screenNext (c:vs)
> > >    in ws{ W.current = c', W.visible = vs' }
> >
> > ...
> >
> > >  -- in keybindings: there are much more W.swap* W.focus* and W.shift*
> functions to use.
> > >  ,((modm, xK_f), onAllWS W.focusDown)
> > >  ,((modm, xK_d), onAllWS W.focusUp)
> > >  ,((modm, xK_g), onAllWS W.swapMaster)
> >
> >
> > Unfortunately, I’m still too terrible at Haskell to fix whatever is
> wrong with the above code, and haven’t found any other modules that have
> the functionality I want. Any help would be appreciated!
>
> Have you looked at XMonad.Actions.CycleWS? I use it to cycle through all
> workspaces with windows in them. My config is customized beyond the
> standard XMonad config so you'd have to adapt it to your needs:
> https://github.com/listx/syscfg/blob/master/xmonad/xmonad.hs#L150
>
> Another alternative might be XMonad.Actions.GridSelect as it gives you a
> popup of all open windows (not workspaces).
>
> Best,
> Linus
>
> >
> > Thanks!
> >
> > Alex
>
> > _______________________________________________
> > xmonad mailing list
> > xmonad at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/xmonad/attachments/20170223/1c2c1c7e/attachment.html>


More information about the xmonad mailing list