aboutsummaryrefslogtreecommitdiffstats
path: root/RotView.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 /RotView.hs
parent47589e1913fb9530481caedb543978a30d4323ea (diff)
downloadXMonadContrib-4866f2e367dfcf22a9591231ba40948826a1b438.tar.gz
XMonadContrib-4866f2e367dfcf22a9591231ba40948826a1b438.tar.xz
XMonadContrib-4866f2e367dfcf22a9591231ba40948826a1b438.zip
Hierarchify
darcs-hash:20071101201059-a5988-fc1f1262bec1b69e13ba18ae7cefeafc8c4471d4.gz
Diffstat (limited to 'RotView.hs')
-rw-r--r--RotView.hs53
1 files changed, 0 insertions, 53 deletions
diff --git a/RotView.hs b/RotView.hs
deleted file mode 100644
index 304eba2..0000000
--- a/RotView.hs
+++ /dev/null
@@ -1,53 +0,0 @@
------------------------------------------------------------------------------
--- |
--- Module : XMonadContrib.RotView
--- Copyright : (c) David Roundy <droundy@darcs.net>
--- License : BSD3-style (see LICENSE)
---
--- Maintainer : David Roundy <droundy@darcs.net>
--- Stability : unstable
--- Portability : unportable
---
--- Provides bindings to cycle through non-empty workspaces.
---
------------------------------------------------------------------------------
-
-module XMonadContrib.RotView (
- -- * Usage
- -- $usage
- rotView
- ) where
-
-import Control.Monad.State ( gets )
-import Data.List ( sortBy, find )
-import Data.Maybe ( isJust )
-import Data.Ord ( comparing )
-
-import XMonad
-import XMonad.StackSet hiding (filter)
-import XMonad.Operations
-
--- $usage
--- You can use this module with the following in your Config.hs file:
---
--- > import XMonadContrib.RotView
---
--- > , ((modMask .|. shiftMask, xK_Right), rotView True)
--- > , ((modMask .|. shiftMask, xK_Left), rotView False)
-
--- %import XMonadContrib.RotView
--- %keybind , ((modMask .|. shiftMask, xK_Right), rotView True)
--- %keybind , ((modMask .|. shiftMask, xK_Left), rotView False)
-
-rotView :: Bool -> X ()
-rotView forward = do
- ws <- gets windowset
- let currentTag = tag . workspace . current $ ws
- sortWs = sortBy (comparing tag)
- isNotEmpty = isJust . stack
- sorted = sortWs (hidden ws)
- pivoted = let (a,b) = span ((< currentTag) . tag) sorted in b ++ a
- pivoted' | forward = pivoted
- | otherwise = reverse pivoted
- nextws = find isNotEmpty pivoted'
- whenJust nextws (windows . view . tag)