xmonad-contrib-0.13: Third party 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 | Haskell98

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 :: Foldable t => forall a. t a -> [a]
- 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.Hooks.DynamicLog
    import XMonad.Util.EZConfig
    import qualified XMonad.StackSet as W

    main = do
        x <- xmobar conf
        xmonad x

    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 #

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

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

toList :: Foldable t => forall a. t a -> [a] #

List of elements of a structure, from left to right.

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

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 #

Instances

LayoutModifier WorkspaceCursors a # |
Methods modifyLayout :: LayoutClass l a => WorkspaceCursors a -> Workspace WorkspaceId (l a) a -> Rectangle -> X ([(a, Rectangle)], Maybe (l a)) # modifyLayoutWithUpdate :: LayoutClass l a => WorkspaceCursors a -> Workspace WorkspaceId (l a) a -> Rectangle -> X (([(a, Rectangle)], Maybe (l a)), Maybe (WorkspaceCursors a)) # handleMess :: WorkspaceCursors a -> SomeMessage -> X (Maybe (WorkspaceCursors a)) # handleMessOrMaybeModifyIt :: WorkspaceCursors a -> SomeMessage -> X (Maybe (Either (WorkspaceCursors a) SomeMessage)) # pureMess :: WorkspaceCursors a -> SomeMessage -> Maybe (WorkspaceCursors a) # redoLayout :: WorkspaceCursors a -> Rectangle -> Maybe (Stack a) -> [(a, Rectangle)] -> X ([(a, Rectangle)], Maybe (WorkspaceCursors a)) # pureModifier :: WorkspaceCursors a -> Rectangle -> Maybe (Stack a) -> [(a, Rectangle)] -> ([(a, Rectangle)], Maybe (WorkspaceCursors a)) # hook :: WorkspaceCursors a -> X () # unhook :: WorkspaceCursors a -> X () # modifierDescription :: WorkspaceCursors a -> String # modifyDescription :: LayoutClass l a => WorkspaceCursors a -> l a -> String #
Read (WorkspaceCursors a) # |
Methods readsPrec :: Int -> ReadS (WorkspaceCursors a) # readList :: ReadS [WorkspaceCursors a] # readPrec :: ReadPrec (WorkspaceCursors a) # readListPrec :: ReadPrec [WorkspaceCursors a] #
Show (WorkspaceCursors a) # |
Methods showsPrec :: Int -> WorkspaceCursors a -> ShowS # show :: WorkspaceCursors a -> String # showList :: [WorkspaceCursors a] -> ShowS #

getFocus :: Cursors b -> b #

# Modifying the focus

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

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

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

example usages are `shiftLayer` and `shiftModifyLayer`

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

`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 () #

`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 #

noWrapUp :: Stack t -> Stack t #

non-wrapping version of `focusUp'`

noWrapDown :: Stack t -> Stack t #

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 DynamicLog 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 #

Instances

Functor Cursors # |
Methods fmap :: (a -> b) -> Cursors a -> Cursors b # (<$) :: a -> Cursors b -> Cursors a #
Foldable Cursors # |
Methods fold :: Monoid m => Cursors m -> m # foldMap :: Monoid m => (a -> m) -> Cursors a -> m # foldr :: (a -> b -> b) -> b -> Cursors a -> b # foldr' :: (a -> b -> b) -> b -> Cursors a -> b # foldl :: (b -> a -> b) -> b -> Cursors a -> b # foldl' :: (b -> a -> b) -> b -> Cursors a -> b # foldr1 :: (a -> a -> a) -> Cursors a -> a # foldl1 :: (a -> a -> a) -> Cursors a -> a # toList :: Cursors a -> [a] # null :: Cursors a -> Bool # length :: Cursors a -> Int # elem :: Eq a => a -> Cursors a -> Bool # maximum :: Ord a => Cursors a -> a # minimum :: Ord a => Cursors a -> a # sum :: Num a => Cursors a -> a # product :: Num a => Cursors a -> a #
Eq a => Eq (Cursors a) # |
Methods (==) :: Cursors a -> Cursors a -> Bool # (/=) :: Cursors a -> Cursors a -> Bool #
Read a => Read (Cursors a) # |
Methods readsPrec :: Int -> ReadS (Cursors a) # readList :: ReadS [Cursors a] # readPrec :: ReadPrec (Cursors a) # readListPrec :: ReadPrec [Cursors a] #
Show a => Show (Cursors a) # |
Methods showsPrec :: Int -> Cursors a -> ShowS # show :: Cursors a -> String # showList :: [Cursors a] -> ShowS #