xmonad-contrib-0.18.1: Community-maintained extensions for xmonad

Copyright | (c) 2009 Adam Vogt <vogt.adam@gmail.com>
License | BSD
Maintainer | Adam Vogt
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

XMonad.Actions.WorkspaceCursors

Contents

- Usage
- Modifying the focus
- Functions to pass to `modifyLayer`
- Todo
- Types

Description

Like XMonad.Actions.Plane for an arbitrary number of dimensions.

Synopsis

- focusDepth :: Cursors t -> Int
- makeCursors :: [[String]] -> Cursors String
- toList :: IsList l => l -> [Item l]
- workspaceCursors :: Cursors String -> l a -> ModifiedLayout WorkspaceCursors l a
- data WorkspaceCursors a
- getFocus :: Cursors b -> b
- modifyLayer :: (Stack (Cursors String) -> Stack (Cursors String)) -> Int -> X ()
- modifyLayer' :: (Stack (Cursors String) -> X (Stack (Cursors String))) -> Int -> X ()
- shiftModifyLayer :: (Stack (Cursors String) -> Stack (Cursors WorkspaceId)) -> Int -> X ()
- shiftLayer :: (Stack (Cursors String) -> Stack (Cursors WorkspaceId)) -> Int -> X ()
- focusNth' :: Int -> Stack a -> Stack a
- noWrapUp :: Stack t -> Stack t
- noWrapDown :: Stack t -> Stack t
- data Cursors a

# Usage

Here is an example config:

    import XMonad
    import XMonad.Actions.WorkspaceCursors
    import XMonad.Util.EZConfig
    import qualified XMonad.StackSet as W

    main = xmonad conf

    conf = additionalKeysP def
           { layoutHook = workspaceCursors myCursors $ layoutHook def
           , workspaces = toList myCursors } $
           [("M-"++shift++control++[k], f direction depth)
             | (f,shift) <- zip [modifyLayer,shiftModifyLayer] ["","S-"]
             , (direction,control) <- zip [W.focusUp',W.focusDown'] ["C-",""]
             , (depth,k) <- zip (reverse [1..focusDepth myCursors]) "asdf"]
           ++ moreKeybindings

    moreKeybindings = []

    myCursors = makeCursors $ map (map (\x -> [x])) [ "1234", "abc", "xyz"]
    -- myCursors = makeCursors [["wsA","wsB","wsC"],["-alpha-","-beta-","-gamma-"],["x","y"]]

focusDepth :: Cursors t -> Int Source #

makeCursors :: [[String]] -> Cursors String Source #

makeCursors requires a nonempty string, and each sublist must be nonempty

toList :: IsList l => l -> [Item l] Source #

The `toList` function extracts a list of `Item l` from the structure `l`. It should satisfy fromList . toList = id.

workspaceCursors :: Cursors String -> l a -> ModifiedLayout WorkspaceCursors l a Source #

The state is stored in the `WorkspaceCursors` layout modifier. Put this as your outermost modifier, unless you want different cursors at different times (using XMonad.Layout.MultiToggle)

data WorkspaceCursors a Source #

#### Instances

Instances details

LayoutModifier WorkspaceCursors a Source # |

Instance details

Defined in XMonad.Actions.WorkspaceCursors

Methods

modifyLayout :: LayoutClass l a => WorkspaceCursors a -> Workspace WorkspaceId (l a) a -> Rectangle -> X ([(a, Rectangle)], Maybe (l a)) Source #

modifyLayoutWithUpdate :: LayoutClass l a => WorkspaceCursors a -> Workspace WorkspaceId (l a) a -> Rectangle -> X (([(a, Rectangle)], Maybe (l a)), Maybe (WorkspaceCursors a)) Source #

handleMess :: WorkspaceCursors a -> SomeMessage -> X (Maybe (WorkspaceCursors a)) Source #

handleMessOrMaybeModifyIt :: WorkspaceCursors a -> SomeMessage -> X (Maybe (Either (WorkspaceCursors a) SomeMessage)) Source #

pureMess :: WorkspaceCursors a -> SomeMessage -> Maybe (WorkspaceCursors a) Source #

redoLayout :: WorkspaceCursors a -> Rectangle -> Maybe (Stack a) -> [(a, Rectangle)] -> X ([(a, Rectangle)], Maybe (WorkspaceCursors a)) Source #

pureModifier :: WorkspaceCursors a -> Rectangle -> Maybe (Stack a) -> [(a, Rectangle)] -> ([(a, Rectangle)], Maybe (WorkspaceCursors a)) Source #

hook :: WorkspaceCursors a -> X () Source #

unhook :: WorkspaceCursors a -> X () Source #

modifierDescription :: WorkspaceCursors a -> String Source #

modifyDescription :: LayoutClass l a => WorkspaceCursors a -> l a -> String Source #

Read (WorkspaceCursors a) Source # |
Instance details Defined in XMonad.Actions.WorkspaceCursors Methods readsPrec :: Int -> ReadS (WorkspaceCursors a) Source # readList :: ReadS [WorkspaceCursors a] Source # readPrec :: ReadPrec (WorkspaceCursors a) Source # readListPrec :: ReadPrec [WorkspaceCursors a] Source #
Show (WorkspaceCursors a) Source # |
Instance details Defined in XMonad.Actions.WorkspaceCursors Methods showsPrec :: Int -> WorkspaceCursors a -> ShowS Source # show :: WorkspaceCursors a -> String Source # showList :: [WorkspaceCursors a] -> ShowS Source #

getFocus :: Cursors b -> b Source #

# Modifying the focus

modifyLayer :: (Stack (Cursors String) -> Stack (Cursors String)) -> Int -> X () Source #

`modifyLayer` is used to change the focus at a given depth

modifyLayer' :: (Stack (Cursors String) -> X (Stack (Cursors String))) -> Int -> X () Source #

example usages are `shiftLayer` and `shiftModifyLayer`

shiftModifyLayer :: (Stack (Cursors String) -> Stack (Cursors WorkspaceId)) -> Int -> X () Source #

`shiftModifyLayer` is the same as `modifyLayer`, but also shifts the currently focused window to the new workspace

shiftLayer :: (Stack (Cursors String) -> Stack (Cursors WorkspaceId)) -> Int -> X () Source #

`shiftLayer` is the same as `shiftModifyLayer`, but the focus remains on the current workspace.

# Functions to pass to `modifyLayer`

focusNth' :: Int -> Stack a -> Stack a Source #

noWrapUp :: Stack t -> Stack t Source #

non-wrapping version of `focusUp'`

noWrapDown :: Stack t -> Stack t Source #

non-wrapping version of `focusDown'`

# Todo

- Find and document how to raise the allowable length of arguments: restoring xmonad's state results in: `xmonad: executeFile: resource exhausted (Argument list too long)` when you specify more than about 50 workspaces. Or change it such that workspaces are created when you try to view it.
- Function for pretty printing for XMonad.Hooks.StatusBar.PP that groups workspaces by common prefixes
- Examples of adding workspaces to the cursors, having them appear multiple times for being able to show jumping to some n'th multiple workspace

# Types

data Cursors a Source #

#### Instances

Instances details

Functor Cursors Source # |
Instance details Defined in XMonad.Actions.WorkspaceCursors Methods fmap :: (a -> b) -> Cursors a -> Cursors b Source # (<$) :: a -> Cursors b -> Cursors a Source #
Foldable Cursors Source # |

Instance details

Defined in XMonad.Actions.WorkspaceCursors

Methods

fold :: Monoid m => Cursors m -> m Source #

foldMap :: Monoid m => (a -> m) -> Cursors a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Cursors a -> m Source #

foldr :: (a -> b -> b) -> b -> Cursors a -> b Source #

foldr' :: (a -> b -> b) -> b -> Cursors a -> b Source #

foldl :: (b -> a -> b) -> b -> Cursors a -> b Source #

foldl' :: (b -> a -> b) -> b -> Cursors a -> b Source #

foldr1 :: (a -> a -> a) -> Cursors a -> a Source #

foldl1 :: (a -> a -> a) -> Cursors a -> a Source #

toList :: Cursors a -> [a] Source #

null :: Cursors a -> Bool Source #

length :: Cursors a -> Int Source #

elem :: Eq a => a -> Cursors a -> Bool Source #

maximum :: Ord a => Cursors a -> a Source #

minimum :: Ord a => Cursors a -> a Source #

sum :: Num a => Cursors a -> a Source #

product :: Num a => Cursors a -> a Source #

Read a => Read (Cursors a) Source # |
Instance details Defined in XMonad.Actions.WorkspaceCursors Methods readsPrec :: Int -> ReadS (Cursors a) Source # readList :: ReadS [Cursors a] Source # readPrec :: ReadPrec (Cursors a) Source # readListPrec :: ReadPrec [Cursors a] Source #
Show a => Show (Cursors a) Source # |
Instance details Defined in XMonad.Actions.WorkspaceCursors Methods showsPrec :: Int -> Cursors a -> ShowS Source # show :: Cursors a -> String Source # showList :: [Cursors a] -> ShowS Source #
Eq a => Eq (Cursors a) Source # |
Instance details Defined in XMonad.Actions.WorkspaceCursors Methods (==) :: Cursors a -> Cursors a -> Bool Source # (/=) :: Cursors a -> Cursors a -> Bool Source #