mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-26 09:41:52 -07:00
REMOVE RotView: use CycleWS instead.
See CycleWS docs for info on switching, or just look at the changes to XMonad.Config.Droundy.
This commit is contained in:
@@ -16,24 +16,19 @@
|
|||||||
-- subset of workspaces, and to cycle by more than one workspace at a
|
-- subset of workspaces, and to cycle by more than one workspace at a
|
||||||
-- time.
|
-- time.
|
||||||
--
|
--
|
||||||
-- Note that this module now subsumes the functionality of
|
-- Note that this module now subsumes the functionality of the former
|
||||||
-- "XMonad.Actions.RotView". To wit, 'XMonad.Actions.RotView.rotView'
|
-- @XMonad.Actions.RotView@. Former users of @rotView@ can simply replace
|
||||||
-- can be implemented in terms of "XMonad.Actions.CycleWS" functions as
|
-- @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
|
-- > rotView b = do t <- findWorkspace getSortByTag (bToDir b) NonEmptyWS 1
|
||||||
-- > windows . greedyView $ t
|
-- > windows . greedyView $ t
|
||||||
-- > where bToDir True = Next
|
-- > where bToDir True = Next
|
||||||
-- > bToDir False = Prev
|
-- > 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 (
|
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
|
-- For ideas of what to do with a workspace tag once obtained, note
|
||||||
-- that 'moveTo' and 'shiftTo' are implemented by applying @(>>=
|
-- 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'.
|
-- to the output of 'findWorkspace'.
|
||||||
findWorkspace :: X WorkspaceSort -> WSDirection -> WSType -> Int -> X WorkspaceId
|
findWorkspace :: X WorkspaceSort -> WSDirection -> WSType -> Int -> X WorkspaceId
|
||||||
findWorkspace s dir t n = findWorkspaceGen s (wsTypeToPred t) (maybeNegate dir n)
|
findWorkspace s dir t n = findWorkspaceGen s (wsTypeToPred t) (maybeNegate dir n)
|
||||||
|
@@ -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)
|
|
@@ -39,7 +39,7 @@ import XMonad.Prompt.Shell
|
|||||||
|
|
||||||
import XMonad.Actions.CopyWindow
|
import XMonad.Actions.CopyWindow
|
||||||
import XMonad.Actions.DynamicWorkspaces
|
import XMonad.Actions.DynamicWorkspaces
|
||||||
import XMonad.Actions.RotView
|
import XMonad.Actions.CycleWS
|
||||||
|
|
||||||
import XMonad.Hooks.ManageDocks
|
import XMonad.Hooks.ManageDocks
|
||||||
import XMonad.Hooks.UrgencyHook
|
import XMonad.Hooks.UrgencyHook
|
||||||
@@ -83,8 +83,8 @@ keys x = M.fromList $
|
|||||||
layoutScreens 1 (fixedLayout [Rectangle 0 0 1024 768]))
|
layoutScreens 1 (fixedLayout [Rectangle 0 0 1024 768]))
|
||||||
, ((modMask x .|. shiftMask .|. controlMask, xK_z),
|
, ((modMask x .|. shiftMask .|. controlMask, xK_z),
|
||||||
layoutScreens 1 (fixedLayout [Rectangle 0 0 1440 900]))
|
layoutScreens 1 (fixedLayout [Rectangle 0 0 1440 900]))
|
||||||
, ((modMask x .|. shiftMask, xK_Right), rotView True)
|
, ((modMask x .|. shiftMask, xK_Right), moveTo Next NonEmptyWS)
|
||||||
, ((modMask x .|. shiftMask, xK_Left), rotView False)
|
, ((modMask x .|. shiftMask, xK_Left), moveTo Prev NonEmptyWS)
|
||||||
, ((modMask x, xK_Right), sendMessage $ Go R)
|
, ((modMask x, xK_Right), sendMessage $ Go R)
|
||||||
, ((modMask x, xK_Left), sendMessage $ Go L)
|
, ((modMask x, xK_Left), sendMessage $ Go L)
|
||||||
, ((modMask x, xK_Up), sendMessage $ Go U)
|
, ((modMask x, xK_Up), sendMessage $ Go U)
|
||||||
|
@@ -150,8 +150,6 @@ edit your key bindings.
|
|||||||
|
|
||||||
* "XMonad.Actions.RotSlaves": rotate non-master windows.
|
* "XMonad.Actions.RotSlaves": rotate non-master windows.
|
||||||
|
|
||||||
* "XMonad.Actions.RotView": cycle through non-empty workspaces.
|
|
||||||
|
|
||||||
* "XMonad.Actions.Search": provide helpful functions for easily
|
* "XMonad.Actions.Search": provide helpful functions for easily
|
||||||
running web searchs.
|
running web searchs.
|
||||||
|
|
||||||
|
@@ -74,7 +74,6 @@ library
|
|||||||
XMonad.Actions.MouseGestures
|
XMonad.Actions.MouseGestures
|
||||||
XMonad.Actions.NoBorders
|
XMonad.Actions.NoBorders
|
||||||
XMonad.Actions.RotSlaves
|
XMonad.Actions.RotSlaves
|
||||||
XMonad.Actions.RotView
|
|
||||||
XMonad.Actions.Search
|
XMonad.Actions.Search
|
||||||
XMonad.Actions.SimpleDate
|
XMonad.Actions.SimpleDate
|
||||||
XMonad.Actions.SinkAll
|
XMonad.Actions.SinkAll
|
||||||
|
Reference in New Issue
Block a user