xmonad-contrib-0.10: Third party extensions for xmonad





Remember a dynamically updateable ordering on workspaces, together with tools for using this ordering with XMonad.Actions.CycleWS and XMonad.Hooks.DynamicLog.



You can use this module by importing it into your ~/.xmonad/xmonad.hs file:

 import qualified XMonad.Actions.DynamicWorkspaceOrder as DO

Then add keybindings to swap the order of workspaces (these examples use XMonad.Util.EZConfig emacs-style keybindings):

        , ("M-C-<R>",   DO.swapWith Next NonEmptyWS)
        , ("M-C-<L>",   DO.swapWith Prev NonEmptyWS)

See XMonad.Actions.CycleWS for information on the possible arguments to swapWith.

However, by itself this will do nothing; swapWith does not change the actual workspaces in any way. It simply keeps track of an auxiliary ordering on workspaces. Anything which cares about the order of workspaces must be updated to use the auxiliary ordering.

To change the order in which workspaces are displayed by XMonad.Hooks.DynamicLog, use getSortByOrder in your XMonad.Hooks.DynamicLog.ppSort field, for example:

   ... dynamicLogWithPP $ byorgeyPP {
     , ppSort = DO.getSortByOrder

To use workspace cycling commands like those from XMonad.Actions.CycleWS, use the versions of moveTo, moveToGreedy, and shiftTo exported by this module. For example:

     , ("M-S-<R>",   DO.shiftTo Next HiddenNonEmptyWS)
     , ("M-S-<L>",   DO.shiftTo Prev HiddenNonEmptyWS)
     , ("M-<R>",     DO.moveTo Next HiddenNonEmptyWS)
     , ("M-<L>",     DO.moveTo Prev HiddenNonEmptyWS)

For slight variations on these, use the source for examples and tweak as desired.

getWsCompareByOrder :: X WorkspaceCompareSource

A comparison function which orders workspaces according to the stored dynamic ordering.

getSortByOrder :: X WorkspaceSortSource

Sort workspaces according to the stored dynamic ordering.

swapWith :: Direction1D -> WSType -> X ()Source

Swap the current workspace with another workspace in the stored dynamic order.

moveTo :: Direction1D -> WSType -> X ()Source

View the next workspace of the given type in the given direction, where "next" is determined using the dynamic workspace order.

moveToGreedy :: Direction1D -> WSType -> X ()Source

Same as moveTo, but using greedyView instead of view.

shiftTo :: Direction1D -> WSType -> X ()Source

Shift the currently focused window to the next workspace of the given type in the given direction, using the dynamic workspace order.