Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 16551e78563a5b49ff9624ee1c8b8101 > files > 702

ghc-xmonad-contrib-devel-0.11-1.1.fc18.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>XMonad.Actions.CycleWindows</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_XMonad-Actions-CycleWindows.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/XMonad-Actions-CycleWindows.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">xmonad-contrib-0.11: Third party extensions for xmonad</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>unportable</td></tr><tr><th>Stability</th><td>unstable</td></tr><tr><th>Maintainer</th><td>Wirt Wolff &lt;wirtwolff@gmail.com&gt;</td></tr><tr><th>Safe Haskell</th><td>Safe-Infered</td></tr></table><p class="caption">XMonad.Actions.CycleWindows</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Usage
</a></li><li><a href="#g:2">Cycling nearby or nth window into current frame
</a></li><li><a href="#g:3">Cycling half the stack to get rid of a boring window
</a></li><li><a href="#g:4">Cycling windows through the current frame
</a></li><li><a href="#g:5">Cycling windows through other frames
</a></li><li><a href="#g:6">Updating the mouse pointer
</a></li><li><a href="#g:7">Generic list rotations
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Provides bindings to cycle windows up or down on the current workspace
 stack while maintaining focus in place.
</p><p>Bindings are available to:
</p><ul><li> Cycle nearby or nth windows into the focused frame
</li><li> Cycle a window halfway around the stack
</li><li> Cycle windows through the focused position.
</li><li> Cycle unfocused windows.
</li></ul><p>These bindings are especially useful with layouts that hide some of
 the windows in the stack, such as Full, <a href="XMonad-Layout-TwoPane.html">XMonad.Layout.TwoPane</a> or
 when using <a href="XMonad-Layout-LimitWindows.html">XMonad.Layout.LimitWindows</a> to only show three or four
 panes. See also <a href="XMonad-Actions-RotSlaves.html">XMonad.Actions.RotSlaves</a> for related actions.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:cycleRecentWindows">cycleRecentWindows</a> :: [<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>] -&gt; <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:cycleStacks-39-">cycleStacks'</a> :: (<a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:Window">Window</a> -&gt; [<a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:Window">Window</a>]) -&gt; [<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>] -&gt; <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:rotOpposite-39-">rotOpposite'</a> ::  <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a</li><li class="src short"><a href="#v:rotOpposite">rotOpposite</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:rotFocused-39-">rotFocused'</a> ::  ([a] -&gt; [a]) -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a</li><li class="src short"><a href="#v:rotFocusedUp">rotFocusedUp</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:rotFocusedDown">rotFocusedDown</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:shiftToFocus-39-">shiftToFocus'</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Text-Show.html#t:Show">Show</a> a, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Text-Read.html#t:Read">Read</a> a) =&gt; a -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a</li><li class="src short"><a href="#v:rotUnfocused-39-">rotUnfocused'</a> ::  ([a] -&gt; [a]) -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a</li><li class="src short"><a href="#v:rotUnfocusedUp">rotUnfocusedUp</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:rotUnfocusedDown">rotUnfocusedDown</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:rotUp">rotUp</a> ::  [a] -&gt; [a]</li><li class="src short"><a href="#v:rotDown">rotDown</a> ::  [a] -&gt; [a]</li></ul></div><div id="interface"><h1 id="g:1">Usage
</h1><div class="doc"><p>You can use this module with the following in your <code>~/.xmonad/xmonad.hs</code> file:
</p><pre> 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)
  , ((modm, xK_z), rotOpposite)
  , ((modm                , xK_i), rotUnfocusedUp)
  , ((modm                , xK_u), rotUnfocusedDown)
  , ((modm .|. controlMask, xK_i), rotFocusedUp)
  , ((modm .|. controlMask, xK_u), rotFocusedDown)
</pre><p>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 <a href="XMonad-Doc-Extending.html#Editing_key_bindings">XMonad.Doc.Extending</a>.
</p></div><h1 id="g:2">Cycling nearby or nth window into current frame
</h1><div class="doc"><p>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 &quot;bring from below&quot; action.  Also, once cycling, pressing a number key n
 will focus the nth window, with 0 being the one originally focused.
</p></div><div class="top"><p class="src"><a name="v:cycleRecentWindows" class="def">cycleRecentWindows</a><a href="src/XMonad-Actions-CycleWindows.html#cycleRecentWindows" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: [<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>]</td><td class="doc"><p>A list of modifier keys used when invoking this action.
   As soon as one of them is released, the final switch is made.
</p></td></tr><tr><td class="src">-&gt; <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a></td><td class="doc"><p>Key used to shift windows from below the current choice into the current frame.
</p></td></tr><tr><td class="src">-&gt; <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a></td><td class="doc"><p>Key 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.
</p></td></tr><tr><td class="src">-&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div><div class="top"><p class="src"><a name="v:cycleStacks-39-" class="def">cycleStacks'</a><a href="src/XMonad-Actions-CycleWindows.html#cycleStacks%27" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:Window">Window</a> -&gt; [<a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:Window">Window</a>])</td><td class="doc"><p>A function to a finite list of permutations of a given stack.
</p></td></tr><tr><td class="src">-&gt; [<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>]</td><td class="doc"><p>A list of modifier keys used to invoke <code><a href="XMonad-Actions-CycleWindows.html#v:cycleStacks-39-">cycleStacks'</a></code>.
   As soon as any is released, we're no longer cycling on the [Stack Window]
</p></td></tr><tr><td class="src">-&gt; <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a></td><td class="doc"><p>Key used to select a &quot;next&quot; stack.
</p></td></tr><tr><td class="src">-&gt; <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a></td><td class="doc"><p>Key used to select a &quot;previous&quot; stack.
</p></td></tr><tr><td class="src">-&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Cycle through a <em>finite</em> 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 &quot;bring from below&quot;
   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.
</p></div></div><h1 id="g:3">Cycling half the stack to get rid of a boring window
</h1><div class="doc"><p>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 &quot;opposite&quot;
 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.
</p></div><div class="top"><p class="src"><a name="v:rotOpposite-39-" class="def">rotOpposite'</a> ::  <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a<a href="src/XMonad-Actions-CycleWindows.html#rotOpposite%27" class="link">Source</a></p><div class="doc"><p>The opposite rotation on a Stack.
</p></div></div><div class="top"><p class="src"><a name="v:rotOpposite" class="def">rotOpposite</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/XMonad-Actions-CycleWindows.html#rotOpposite" class="link">Source</a></p></div><h1 id="g:4">Cycling windows through the current frame
</h1><div class="doc"><p>Most people will want the <code>rotAllUp</code> or <code>rotAllDown</code> actions from
 <a href="XMonad-Actions-RotSlaves.html">XMonad.Actions.RotSlaves</a> to cycle all windows in the stack.
</p><p>The following actions keep the &quot;next&quot; window stable, which is
 mostly useful in two window layouts, or when you have a log viewer or
 buffer window you want to keep next to the cycled window.
</p></div><div class="top"><p class="src"><a name="v:rotFocused-39-" class="def">rotFocused'</a> ::  ([a] -&gt; [a]) -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a<a href="src/XMonad-Actions-CycleWindows.html#rotFocused%27" class="link">Source</a></p><div class="doc"><p>The focused rotation on a stack.
</p></div></div><div class="top"><p class="src"><a name="v:rotFocusedUp" class="def">rotFocusedUp</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/XMonad-Actions-CycleWindows.html#rotFocusedUp" class="link">Source</a></p><div class="doc"><p>Rotate windows through the focused frame, excluding the &quot;next&quot; 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.
</p></div></div><div class="top"><p class="src"><a name="v:rotFocusedDown" class="def">rotFocusedDown</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/XMonad-Actions-CycleWindows.html#rotFocusedDown" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:shiftToFocus-39-" class="def">shiftToFocus'</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Text-Show.html#t:Show">Show</a> a, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Text-Read.html#t:Read">Read</a> a) =&gt; a -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a<a href="src/XMonad-Actions-CycleWindows.html#shiftToFocus%27" class="link">Source</a></p><div class="doc"><p>Given a stack element and a stack, shift or insert the element (window)
   at the currently focused position.
</p></div></div><h1 id="g:5">Cycling windows through other frames
</h1><div class="doc"><p>Rotate windows through the unfocused frames. This is similar to
 <code>rotSlaves</code>, from <a href="XMonad-Actions-RotSlaves.html">XMonad.Actions.RotSlaves</a>, but excludes the current
 frame rather than master.
</p></div><div class="top"><p class="src"><a name="v:rotUnfocused-39-" class="def">rotUnfocused'</a> ::  ([a] -&gt; [a]) -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:Stack">Stack</a> a<a href="src/XMonad-Actions-CycleWindows.html#rotUnfocused%27" class="link">Source</a></p><div class="doc"><p>The unfocused rotation on a stack.
</p></div></div><div class="top"><p class="src"><a name="v:rotUnfocusedUp" class="def">rotUnfocusedUp</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/XMonad-Actions-CycleWindows.html#rotUnfocusedUp" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:rotUnfocusedDown" class="def">rotUnfocusedDown</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/XMonad-Actions-CycleWindows.html#rotUnfocusedDown" class="link">Source</a></p></div><h1 id="g:6">Updating the mouse pointer
</h1><div class="doc"><p>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 <a href="XMonad-Actions-UpdatePointer.html">XMonad.Actions.UpdatePointer</a>, or <a href="XMonad-Actions-Warp.html">XMonad.Actions.Warp</a>)
</p><p>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:
</p><pre> import XMonad.Actions.UpdatePointer -- or Actions.Warp
</pre><p>and either
</p><pre> -- modify the window rotation bindings
 , ((modm .|. controlMask, xK_i   ), rotFocusedUp
                                            &gt;&gt; updatePointer (Relative 1 1))
 , ((modm .|. controlMask, xK_u   ), rotFocusedDown
                                            &gt;&gt; updatePointer (Relative 1 1))

    -- or add to xmonad's logHook
    , logHook = dynamicLogWithPP xmobarPP
                    &gt;&gt; updatePointer Nearest -- or your preference
</pre></div><h1 id="g:7">Generic list rotations
</h1><div class="doc"><p>Generic list rotations such that <code>rotUp [1..4]</code> is equivalent to
 <code>[2,3,4,1]</code> and <code>rotDown [1..4]</code> to <code>[4,1,2,3]</code>. They both are
 <code>id</code> for null or singleton lists.
</p></div><div class="top"><p class="src"><a name="v:rotUp" class="def">rotUp</a> ::  [a] -&gt; [a]<a href="src/XMonad-Actions-CycleWindows.html#rotUp" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:rotDown" class="def">rotDown</a> ::  [a] -&gt; [a]<a href="src/XMonad-Actions-CycleWindows.html#rotDown" class="link">Source</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.10.0</p></div></body></html>