diff options
author | Brent Yorgey <byorgey@gmail.com> | 2008-02-01 19:06:18 +0100 |
---|---|---|
committer | Brent Yorgey <byorgey@gmail.com> | 2008-02-01 19:06:18 +0100 |
commit | 6b4aa7efb8a2a9c82a8610ae8ab25108e32d1e15 (patch) | |
tree | 9478cd5f10b54294cc56dc4cbce04e755f4f620c | |
parent | a99d18cccbaa0d2c26d4d85b2bf7fb13eb9462c5 (diff) | |
download | XMonadContrib-6b4aa7efb8a2a9c82a8610ae8ab25108e32d1e15.tar.gz XMonadContrib-6b4aa7efb8a2a9c82a8610ae8ab25108e32d1e15.tar.xz XMonadContrib-6b4aa7efb8a2a9c82a8610ae8ab25108e32d1e15.zip |
REMOVE RotView: use CycleWS instead.
See CycleWS docs for info on switching, or just look at the changes to
XMonad.Config.Droundy.
darcs-hash:20080201180618-bd4d7-7b4deec416c0afd7926b44652bd00cfede1e5e17.gz
-rw-r--r-- | XMonad/Actions/CycleWS.hs | 21 | ||||
-rw-r--r-- | XMonad/Actions/RotView.hs | 58 | ||||
-rw-r--r-- | XMonad/Config/Droundy.hs | 6 | ||||
-rw-r--r-- | XMonad/Doc/Extending.hs | 2 | ||||
-rw-r--r-- | xmonad-contrib.cabal | 1 |
5 files changed, 11 insertions, 77 deletions
diff --git a/XMonad/Actions/CycleWS.hs b/XMonad/Actions/CycleWS.hs index c63afe9..463c449 100644 --- a/XMonad/Actions/CycleWS.hs +++ b/XMonad/Actions/CycleWS.hs @@ -16,24 +16,19 @@ -- subset of workspaces, and to cycle by more than one workspace at a -- time. -- --- Note that this module now subsumes the functionality of --- "XMonad.Actions.RotView". To wit, 'XMonad.Actions.RotView.rotView' --- can be implemented in terms of "XMonad.Actions.CycleWS" functions as +-- Note that this module now subsumes the functionality of the former +-- @XMonad.Actions.RotView@. Former users of @rotView@ can simply replace +-- @rotView True@ with @moveTo Next NonEmptyWS@, and so on. +-- +-- If you want to exactly replicate the action of @rotView@ (cycling +-- through workspace in order lexicographically by tag, instead of in +-- the order specified in the config), it can be implemented as: -- -- > rotView b = do t <- findWorkspace getSortByTag (bToDir b) NonEmptyWS 1 -- > windows . greedyView $ t -- > where bToDir True = Next -- > bToDir False = Prev -- --- Of course, usually one would want to use --- 'XMonad.Util.WorkspaceCompare.getSortByIndex' instead of --- 'XMonad.Util.WorkspaceCompare.getSortByTag', to cycle through the --- workspaces in the order in which they are listed in your config, --- instead of alphabetical order (as is the default in --- 'XMonad.Actions.RotView.rotView'). In this case one can simply use --- @moveTo Next NonEmptyWS@ and @moveTo Prev NonEmptyWS@ in place of --- @rotView True@ and @rotView False@, respectively. --- ----------------------------------------------------------------------------- module XMonad.Actions.CycleWS ( @@ -208,7 +203,7 @@ shiftTo dir t = findWorkspace getSortByIndex dir t 1 >>= windows . shift -- -- For ideas of what to do with a workspace tag once obtained, note -- that 'moveTo' and 'shiftTo' are implemented by applying @(>>= --- windows . greedyView)@ and @(>>= windows . shift)@, respectively, +-- (windows . greedyView))@ and @(>>= (windows . shift))@, respectively, -- to the output of 'findWorkspace'. findWorkspace :: X WorkspaceSort -> WSDirection -> WSType -> Int -> X WorkspaceId findWorkspace s dir t n = findWorkspaceGen s (wsTypeToPred t) (maybeNegate dir n) diff --git a/XMonad/Actions/RotView.hs b/XMonad/Actions/RotView.hs deleted file mode 100644 index f7c1333..0000000 --- a/XMonad/Actions/RotView.hs +++ /dev/null @@ -1,58 +0,0 @@ ------------------------------------------------------------------------------ --- | --- Module : XMonad.Actions.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 XMonad.Actions.RotView ( - -- * Usage - -- $usage - rotView - ) where - -import Data.List ( sortBy, find ) -import Data.Maybe ( isJust ) -import Data.Ord ( comparing ) - -import XMonad -import XMonad.StackSet hiding (filter) - --- $usage --- --- NOTE: This module is deprecated; see "XMonad.Actions.CycleWS". --- --- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@: --- --- > import XMonad.Actions.RotView --- --- Then add appropriate key bindings, such as: --- --- > , ((modMask x .|. shiftMask, xK_Right), rotView True) --- > , ((modMask x .|. shiftMask, xK_Left), rotView False) --- --- For detailed instructions on editing your key bindings, see --- "XMonad.Doc.Extending#Editing_key_bindings". - --- | Cycle through non-empty workspaces. True --> cycle in the forward --- direction. Note that workspaces cycle in order by tag, so if your --- workspaces are not in tag-order, the cycling might seem wonky. -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) diff --git a/XMonad/Config/Droundy.hs b/XMonad/Config/Droundy.hs index 5538376..a4b34f7 100644 --- a/XMonad/Config/Droundy.hs +++ b/XMonad/Config/Droundy.hs @@ -39,7 +39,7 @@ import XMonad.Prompt.Shell import XMonad.Actions.CopyWindow import XMonad.Actions.DynamicWorkspaces -import XMonad.Actions.RotView +import XMonad.Actions.CycleWS import XMonad.Hooks.ManageDocks import XMonad.Hooks.UrgencyHook @@ -83,8 +83,8 @@ keys x = M.fromList $ layoutScreens 1 (fixedLayout [Rectangle 0 0 1024 768])) , ((modMask x .|. shiftMask .|. controlMask, xK_z), layoutScreens 1 (fixedLayout [Rectangle 0 0 1440 900])) - , ((modMask x .|. shiftMask, xK_Right), rotView True) - , ((modMask x .|. shiftMask, xK_Left), rotView False) + , ((modMask x .|. shiftMask, xK_Right), moveTo Next NonEmptyWS) + , ((modMask x .|. shiftMask, xK_Left), moveTo Prev NonEmptyWS) , ((modMask x, xK_Right), sendMessage $ Go R) , ((modMask x, xK_Left), sendMessage $ Go L) , ((modMask x, xK_Up), sendMessage $ Go U) diff --git a/XMonad/Doc/Extending.hs b/XMonad/Doc/Extending.hs index 7ca338e..13a4064 100644 --- a/XMonad/Doc/Extending.hs +++ b/XMonad/Doc/Extending.hs @@ -150,8 +150,6 @@ edit your key bindings. * "XMonad.Actions.RotSlaves": rotate non-master windows. -* "XMonad.Actions.RotView": cycle through non-empty workspaces. - * "XMonad.Actions.Search": provide helpful functions for easily running web searchs. diff --git a/xmonad-contrib.cabal b/xmonad-contrib.cabal index 24dae39..9419e91 100644 --- a/xmonad-contrib.cabal +++ b/xmonad-contrib.cabal @@ -74,7 +74,6 @@ library XMonad.Actions.MouseGestures XMonad.Actions.NoBorders XMonad.Actions.RotSlaves - XMonad.Actions.RotView XMonad.Actions.Search XMonad.Actions.SimpleDate XMonad.Actions.SinkAll |