diff options
author | Devin Mullins <me@twifkak.com> | 2007-10-12 16:54:47 +0200 |
---|---|---|
committer | Devin Mullins <me@twifkak.com> | 2007-10-12 16:54:47 +0200 |
commit | 1254dd41509a031008799cb6850181705eae320b (patch) | |
tree | f758dfc093091880186e90fbcd38e6019123bc96 /SwapWorkspaces.hs | |
parent | db56cbb7ed63d02e70ecc24ab88a0342d1c99c5e (diff) | |
download | XMonadContrib-1254dd41509a031008799cb6850181705eae320b.tar.gz XMonadContrib-1254dd41509a031008799cb6850181705eae320b.tar.xz XMonadContrib-1254dd41509a031008799cb6850181705eae320b.zip |
haddock improvement
darcs-hash:20071012145447-78224-ddfc6b2085e85d92547aac3fc027c0dd4bad9cd3.gz
Diffstat (limited to 'SwapWorkspaces.hs')
-rw-r--r-- | SwapWorkspaces.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/SwapWorkspaces.hs b/SwapWorkspaces.hs index a6aff7e..277ae6a 100644 --- a/SwapWorkspaces.hs +++ b/SwapWorkspaces.hs @@ -12,9 +12,7 @@ -- each other, without having to move individual windows. -- -- TODO: add quickcheck props for: --- -- * double swap invariant (guarantees no 'loss' of workspaces) --- -- * non-swapped ws's invariant -- ----------------------------------------------------------------------------- @@ -43,10 +41,17 @@ import StackSet -- %keybindlist ++ -- %keybindlist [((modMask .|. controlMask, k), windows $ swapWithCurrent i) -- %keybindlist | (i, k) <- zip workspaces [xK_1 ..]] +-- +-- After installing this update, if you're on workspace 1, hitting mod-ctrl-5 +-- will swap workspaces 1 and 5. +-- | Swaps the currently focused workspace with the given workspace tag, via +-- @swapWorkspaces@. swapWithCurrent :: Eq i => i -> StackSet i l a s sd -> StackSet i l a s sd swapWithCurrent t s = swapWorkspaces t (tag $ workspace $ current s) s +-- | Takes two workspace tags and an existing StackSet and returns a new +-- one with the two corresponding workspaces' tags swapped. swapWorkspaces :: Eq i => i -> i -> StackSet i l a s sd -> StackSet i l a s sd swapWorkspaces t1 t2 = mapWorkspace swap where swap w = if tag w == t1 then w { tag = t2 } |