aboutsummaryrefslogtreecommitdiffstats
path: root/SwapWorkspaces.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-11-01 21:10:59 +0100
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-11-01 21:10:59 +0100
commit4866f2e367dfcf22a9591231ba40948826a1b438 (patch)
tree7a245caee3f146826b267d773b7eaa80386a818e /SwapWorkspaces.hs
parent47589e1913fb9530481caedb543978a30d4323ea (diff)
downloadXMonadContrib-4866f2e367dfcf22a9591231ba40948826a1b438.tar.gz
XMonadContrib-4866f2e367dfcf22a9591231ba40948826a1b438.tar.xz
XMonadContrib-4866f2e367dfcf22a9591231ba40948826a1b438.zip
Hierarchify
darcs-hash:20071101201059-a5988-fc1f1262bec1b69e13ba18ae7cefeafc8c4471d4.gz
Diffstat (limited to 'SwapWorkspaces.hs')
-rw-r--r--SwapWorkspaces.hs55
1 files changed, 0 insertions, 55 deletions
diff --git a/SwapWorkspaces.hs b/SwapWorkspaces.hs
deleted file mode 100644
index 735426f..0000000
--- a/SwapWorkspaces.hs
+++ /dev/null
@@ -1,55 +0,0 @@
------------------------------------------------------------------------------
--- |
--- Module : XMonadContrib.SwapWorkspaces
--- Copyright : (c) Devin Mullins <me@twifkak.com>
--- License : BSD3-style (see LICENSE)
---
--- Maintainer : Devin Mullins <me@twifkak.com>
--- Stability : unstable
--- Portability : unportable
---
--- Lets you swap workspace tags, so you can keep related ones next to
--- each other, without having to move individual windows.
---
------------------------------------------------------------------------------
-
-module XMonadContrib.SwapWorkspaces (
- -- * Usage
- -- $usage
- swapWithCurrent,
- swapWorkspaces
- ) where
-
-import XMonad.StackSet
-
--- $usage
--- Add this import to your Config.hs:
---
--- > import XMonadContrib.SwapWorkspaces
---
--- Throw this in your keys definition:
---
--- > ++
--- > [((modMask .|. controlMask, k), windows $ swapWithCurrent i)
--- > | (i, k) <- zip workspaces [xK_1 ..]]
-
--- %import XMonadContrib.SwapWorkspaces
--- %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 XMonad.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 }
- else if tag w == t2 then w { tag = t1 }
- else w