Copyright | (c) Brent Yorgey 2009 |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | <byorgey@gmail.com> |
Stability | experimental |
Portability | unportable |
Safe Haskell | None |
Language | Haskell98 |
Remember a dynamically updateable ordering on workspaces, together with tools for using this ordering with XMonad.Actions.CycleWS and XMonad.Hooks.DynamicLog.
Synopsis
- getWsCompareByOrder :: X WorkspaceCompare
- getSortByOrder :: X WorkspaceSort
- swapWith :: Direction1D -> WSType -> X ()
- updateName :: WorkspaceId -> WorkspaceId -> X ()
- removeName :: WorkspaceId -> X ()
- moveTo :: Direction1D -> WSType -> X ()
- moveToGreedy :: Direction1D -> WSType -> X ()
- shiftTo :: Direction1D -> WSType -> X ()
- withNthWorkspace :: (String -> WindowSet -> WindowSet) -> Int -> X ()
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.DynamicLog, use getSortByOrder
in your
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 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.
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
.