xmonad-contrib-0.17.1: Community-maintained extensions for xmonad
Copyright(c) Brent Yorgey 2009
LicenseBSD-style (see LICENSE)
Maintainer<byorgey@gmail.com>
Stabilityexperimental
Portabilityunportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

XMonad.Actions.DynamicWorkspaceOrder

Contents

Description

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

Synopsis

Usage

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.StatusBar.PP, use getSortByOrder in your ppSort field, for example:

  myPP = ... 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 WorkspaceCompare Source #

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

getSortByOrder :: X WorkspaceSort Source #

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.

swapWithCurrent :: WorkspaceId -> X () Source #

Swap the given workspace with the current one.

swapOrder :: WorkspaceId -> WorkspaceId -> X () Source #

Swap the two given workspaces in the dynamic order.

updateName :: WorkspaceId -> WorkspaceId -> X () Source #

Update the name of a workspace in the stored order.

removeName :: WorkspaceId -> X () Source #

Remove a workspace from the stored 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.

withNthWorkspace' :: ([WorkspaceId] -> [WorkspaceId]) -> (String -> WindowSet -> WindowSet) -> Int -> X () Source #

Do something with the nth workspace in the dynamic order after transforming it. The callback is given the workspace's tag as well as the WindowSet of the workspace itself.

withNthWorkspace :: (String -> WindowSet -> WindowSet) -> Int -> X () Source #

Do something with the nth workspace in the dynamic order. The callback is given the workspace's tag as well as the WindowSet of the workspace itself.