xmonad-contrib-bluetilebranch-0.8.1.2: Third party extensions for xmonadSource codeContentsIndex
XMonad.Actions.CycleWindows
Portabilityunportable
Stabilityunstable
MaintainerWirt Wolff <wirtwolff@gmail.com>
Contents
Usage
Cycling nearby or nth window into current frame
Cycling half the stack to get rid of a boring window
Cycling windows through the current frame
Cycling windows through other frames
Updating the mouse pointer
Generic list rotations
Description

Provides bindings to cycle windows up or down on the current workspace stack while maintaining focus in place. Bindings are available to:

  • Cycle nearby or nth windows into the focused frame
  • Cycle a window halfway around the stack
  • Cycle windows through the focused position.
  • Cycle unfocused windows.

These bindings are especially useful with layouts that hide some of the windows in the stack, such as Full, XMonad.Layout.TwoPane or XMonad.Layout.Mosaic with three or four panes. See also XMonad.Actions.RotSlaves for related actions.

Synopsis
cycleRecentWindows :: [KeySym] -> KeySym -> KeySym -> X ()
cycleStacks' :: (Stack Window -> [Stack Window]) -> [KeySym] -> KeySym -> KeySym -> X ()
rotOpposite' :: Stack a -> Stack a
rotOpposite :: X ()
rotFocused' :: ([a] -> [a]) -> Stack a -> Stack a
rotFocusedUp :: X ()
rotFocusedDown :: X ()
shiftToFocus' :: (Eq a, Show a, Read a) => a -> Stack a -> Stack a
rotUnfocused' :: ([a] -> [a]) -> Stack a -> Stack a
rotUnfocusedUp :: X ()
rotUnfocusedDown :: X ()
rotUp :: [a] -> [a]
rotDown :: [a] -> [a]
Usage

You can use this module with the following in your ~/.xmonad/xmonad.hs file:

 import XMonad.Actions.CycleWindows
    -- config
    -- other key bindings with x here your config

              -- make sure mod matches keysym
  , ((mod4Mask,  xK_s), cycleRecentWindows [xK_Super_L] xK_s xK_w)
  , ((modMask x, xK_z), rotOpposite)
  , ((modMask x                , xK_i), rotUnfocusedUp)
  , ((modMask x                , xK_u), rotUnfocusedDown)
  , ((modMask x .|. controlMask, xK_i), rotFocusedUp)
  , ((modMask x .|. controlMask, xK_u), rotFocusedDown)

Also, if you use focus follows mouse, you will want to read the section on updating the mouse pointer below. For detailed instructions on editing your key bindings, see XMonad.Doc.Extending.

Cycling nearby or nth window into current frame
Cycle windows into focus from below or above the focused pane by pressing a key while one or more modifier keys is held down. The window order isn't changed until a modifier is released, leaving the previously focused window just below the new one, (or above if the window just above is chosen.) For best results use the same modifier + key combination as the one used to invoke the "bring from below" action. Also, once cycling, pressing a number key n will focus the nth window, with 0 being the one originally focused.
cycleRecentWindowsSource
:: [KeySym]A list of modifier keys used when invoking this action. As soon as one of them is released, the final switch is made.
-> KeySymKey used to shift windows from below the current choice into the current frame.
-> KeySymKey used to shift windows from above the current choice into the current frame. If it's the same as the first key, it is effectively ignored.
-> X ()
cycleStacks'Source
:: Stack Window -> [Stack Window]A function to a finite list of permutations of a given stack.
-> [KeySym]A list of modifier keys used to invoke cycleStacks'. As soon as any is released, we're no longer cycling on the [Stack Window]
-> KeySymKey used to select a "next" stack.
-> KeySymKey used to select a "previous" stack.
-> X ()
Cycle through a finite list of window stacks with repeated presses of a key while a modifier key is held down. For best results use the same mod key + key combination as the one used to invoke the "bring from below" action. You could use cycleStacks' with a different stack permutations function to, for example, cycle from one below to one above to two below, etc. instead of in order. You are responsible for having it generate a finite list, though, or xmonad may hang seeking its length.
Cycling half the stack to get rid of a boring window
Shifts the focused window as far as possible from the current focus, i.e. halfway around the stack. Windows above the focus up to the "opposite" position remain in place, while those above the insertion shift toward the current focus. This is useful for people who use lots of windows in Full, TwoPane, etc., to get rid of boring windows while cycling and swapping near the focus.
rotOpposite' :: Stack a -> Stack aSource
The opposite rotation on a Stack.
rotOpposite :: X ()Source
Cycling windows through the current frame
Rotate windows through the focused frame, excluding the "next" window. With, e.g. TwoPane, this allows cycling windows through either the master or slave pane, without changing the other frame. When the master is focused, the window below is skipped, when a non-master window is focused, the master is skipped.
rotFocused' :: ([a] -> [a]) -> Stack a -> Stack aSource
The focused rotation on a stack.
rotFocusedUp :: X ()Source
rotFocusedDown :: X ()Source
shiftToFocus' :: (Eq a, Show a, Read a) => a -> Stack a -> Stack aSource
Given a stack element and a stack, shift or insert the element (window) at the currently focused position.
Cycling windows through other frames
Rotate windows through the unfocused frames. This is similar to rotSlaves, from XMonad.Actions.RotSlaves, but excludes the current frame rather than master.
rotUnfocused' :: ([a] -> [a]) -> Stack a -> Stack aSource
The unfocused rotation on a stack.
rotUnfocusedUp :: X ()Source
rotUnfocusedDown :: X ()Source
Updating the mouse pointer

With FocusFollowsMouse == True, the focus is updated after binding actions, possibly focusing a window you didn't intend to focus. Most people using TwoPane probably already have a logHook causing the mouse to follow focus. (See XMonad.Actions.UpdatePointer, or XMonad.Actions.Warp)

If you want this built into the key binding instead, use the appropriate action from one of those modules to also have your bindings move the pointer to the point of your choice on the current window:

 import XMonad.Actions.UpdatePointer -- or Actions.Warp

and either

 -- modify the window rotation bindings
 , ((modMask x .|. controlMask, xK_i   ), rotFocusedUp
                                            >> updatePointer (Relative 1 1))
 , ((modMask x .|. controlMask, xK_u   ), rotFocusedDown
                                            >> updatePointer (Relative 1 1))

    -- or add to xmonad's logHook
    , logHook = dynamicLogWithPP xmobarPP
                    >> updatePointer Nearest -- or your preference
Generic list rotations
Generic list rotations
rotUp :: [a] -> [a]Source
rotDown :: [a] -> [a]Source
Produced by Haddock version 2.4.2