aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions
diff options
context:
space:
mode:
authorBrent Yorgey <byorgey@gmail.com>2007-11-24 18:45:18 +0100
committerBrent Yorgey <byorgey@gmail.com>2007-11-24 18:45:18 +0100
commit0c6a6fe80212c2a19603d5786661144e897faad4 (patch)
treeaa354997d447ecfc4206e114baca28dc218c6e96 /XMonad/Actions
parent4c36a8cd0f807dc7e8f9d0eaedb9092d7a18d154 (diff)
downloadXMonadContrib-0c6a6fe80212c2a19603d5786661144e897faad4.tar.gz
XMonadContrib-0c6a6fe80212c2a19603d5786661144e897faad4.tar.xz
XMonadContrib-0c6a6fe80212c2a19603d5786661144e897faad4.zip
RotSlaves: haddock updates
darcs-hash:20071124174518-bd4d7-2c7dfbf0776c57333ec9936c2378c6b7057726c7.gz
Diffstat (limited to 'XMonad/Actions')
-rw-r--r--XMonad/Actions/RotSlaves.hs25
1 files changed, 14 insertions, 11 deletions
diff --git a/XMonad/Actions/RotSlaves.hs b/XMonad/Actions/RotSlaves.hs
index d74181b..fab30cb 100644
--- a/XMonad/Actions/RotSlaves.hs
+++ b/XMonad/Actions/RotSlaves.hs
@@ -8,8 +8,8 @@
-- Stability : unstable
-- Portability : unportable
--
--- Rotate all windows except the master window
--- and keep the focus in place.
+-- Rotate all windows except the master window and keep the focus in
+-- place.
-----------------------------------------------------------------------------
module XMonad.Actions.RotSlaves (
-- $usage
@@ -27,22 +27,24 @@ import XMonad
--
-- > import XMonad.Actions.RotSlaves
--
--- and add a keybinding:
+-- and add whatever keybindings you would like, for example:
--
--- > , ((modMask .|. shiftMask, xK_Tab ), rotSlavesUp)
+-- > , ((modMask x .|. shiftMask, xK_Tab ), rotSlavesUp)
--
+-- This operation will rotate all windows except the master window,
+-- while the focus stays where it is. It is useful together with the
+-- TwoPane layout (see "XMonad.Layout.TwoPane").
--
--- This operation will rotate all windows except the master window, while the focus
--- stays where it is. It is useful together with the TwoPane-Layout (see "XMonad.Layout.TwoPane").
+-- For detailed instructions on editing your key bindings, see
+-- "XMonad.Doc.Extending#Editing_key_bindings".
--- %import XMonad.Actions.RotSlaves
--- %keybind , ((modMask .|. shiftMask, xK_Tab ), rotSlavesUp)
-
--- | Rotate the windows in the current stack excluding the first one
+-- | Rotate the windows in the current stack, excluding the first one
+-- (master).
rotSlavesUp,rotSlavesDown :: X ()
rotSlavesUp = windows $ modify' (rotSlaves' (\l -> (tail l)++[head l]))
rotSlavesDown = windows $ modify' (rotSlaves' (\l -> [last l]++(init l)))
+-- | The actual rotation, as a pure function on the window stack.
rotSlaves' :: ([a] -> [a]) -> Stack a -> Stack a
rotSlaves' _ s@(Stack _ [] []) = s
rotSlaves' f (Stack t [] rs) = Stack t [] (f rs) -- Master has focus
@@ -50,11 +52,12 @@ rotSlaves' f s@(Stack _ ls _ ) = Stack t' (reverse revls') rs' -- otherwise
where (master:ws) = integrate s
(revls',t':rs') = splitAt (length ls) (master:(f ws))
--- | Rotate the windows in the current stack
+-- | Rotate all the windows in the current stack.
rotAllUp,rotAllDown :: X ()
rotAllUp = windows $ modify' (rotAll' (\l -> (tail l)++[head l]))
rotAllDown = windows $ modify' (rotAll' (\l -> [last l]++(init l)))
+-- | The actual rotation, as a pure function on the window stack.
rotAll' :: ([a] -> [a]) -> Stack a -> Stack a
rotAll' f s = Stack r (reverse revls) rs
where (revls,r:rs) = splitAt (length (up s)) (f (integrate s))