xmonad / xmonad-contrib

Contributed modules for xmonad
https://xmonad.org
BSD 3-Clause "New" or "Revised" License
584 stars 274 forks source link

Make CycleWS support IndependentScreens #650

Open Vermoot opened 2 years ago

Vermoot commented 2 years ago

Using IndependentScreens, I'd like to be able to move across spaces just like with CycleWS's prevWS and nextWS, but only on the current screen's workspaces (using IndependentScreens).

I've seen a couple implementations of this while searching how to do it, but none have been successful for me.

slotThe commented 2 years ago

Have you tried using X.A.CycleWorkspaceByScreen? The docs are pretty bad, but what you are supposed to do is something like

import XMonad.Hooks.WorkspaceHistory (workspaceHistoryHook)
import XMonad.Util.EZConfig (additionalKeysP)
import XMonad.Actions.CycleWorkspaceByScreen (cycleWorkspaceOnCurrentScreen)

main = xmonad $ def
  { ...
  , logHook = workspaceHistoryHook >> ...
  , ...
  }
 `additionalKeysP` myKeys

myKeys =
  [ ...
  , ("M-/", cycleWorkspaceOnCurrentScreen [xK_Super_L] xK_slash xK_p)
  , ...
  ]

The semantics the different arguments to cycleWorkspaceOnCurrentScreen seem to be the same as the (helpfully explained) X.A.CycleRecentWS.cycleRecentWS

Vermoot commented 2 years ago

This looks like a step in the right direction but I'd like to move across spaces regardless of the viewing order, just like prevWS and nextWS. From what I see cycleWorkspaceOnCurrentScreen only works to move through the history of seen workscreens.