import qualified XMonad.StackSet as W
import qualified XMonad.Layout.SubLayouts as SL
, ("M-S-j", SL.onGroup swapDown')
, ("M-S-k", SL.onGroup swapUp')
]
where swapUp' (W.Stack t (l:ls) rs) = W.Stack t ls (l:rs)
swapUp' (W.Stack t [] rs) = W.Stack t (reverse rs) []
swapDown' = reverseStack . swapUp' . reverseStack
reverseStack (W.Stack t ls rs) = W.Stack t rs ls
swapUp and swapDown don't just swap inside a sublayout group.
Any idea?
Between sublayout groups
swapDown fails to swap the currently focused master window with a tabbed subgroup that has two windows with its second window in focus.
Although XMonad.Actions.Navigation2D.windowSwap swaps sublayout groups and even cycles, it doesn't work when I want to swap the master window with the second window in a Tall layout with 3 windows.
Thus, I end up having to remember when to use swapDown and windowSwap. This complexity prevents me from moving windows instinctively and requires some thoughts.
In a sublayout group
I currently have
I copied
swapUp'
andswapDown'
from https://github.com/xmonad/xmonad/blob/1b17d1c3781f882e8346acd4a3291a5cd632f4be/src/XMonad/StackSet.hs#L348-L364SL.onGroup swapDown'
andSL.onGroup swapUp'
don't seem to swap tabs in a sublayout group.SL.onGroup W.focusUp'
andSL.onGroup W.focusDown'
work perfectly.I have the same issue as https://www.reddit.com/r/xmonad/comments/60g643/swap_windows_in_sublayout/
swapUp
andswapDown
don't just swap inside a sublayout group.Any idea?
Between sublayout groups
swapDown
fails to swap the currently focused master window with a tabbed subgroup that has two windows with its second window in focus.Although
XMonad.Actions.Navigation2D.windowSwap
swaps sublayout groups and even cycles, it doesn't work when I want to swap the master window with the second window in a Tall layout with 3 windows.Thus, I end up having to remember when to use
swapDown
andwindowSwap
. This complexity prevents me from moving windows instinctively and requires some thoughts.I want swap functions aware of sublayout groups.