<!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.WorkspaceCursors</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-WorkspaceCursors.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/XMonad-Actions-WorkspaceCursors.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.9.2: 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>Adam Vogt</td></tr></table><p class="caption">XMonad.Actions.WorkspaceCursors</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">Modifying the focus </a></li><li><a href="#g:3">Functions to pass to <code><a href="XMonad-Actions-WorkspaceCursors.html#v:modifyLayer">modifyLayer</a></code> </a></li><li><a href="#g:4">Todo </a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Like <a href="XMonad-Actions-Plane.html">XMonad.Actions.Plane</a> for an arbitrary number of dimensions. </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:focusDepth">focusDepth</a> :: Cursors t -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:makeCursors">makeCursors</a> :: [[<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>]] -> Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li class="src short"><a href="#v:toList">toList</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Foldable.html#t:Foldable">Foldable</a> t => t a -> [a]</li><li class="src short"><a href="#v:workspaceCursors">workspaceCursors</a> :: Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> -> l a -> <a href="XMonad-Layout-LayoutModifier.html#t:ModifiedLayout">ModifiedLayout</a> <a href="XMonad-Actions-WorkspaceCursors.html#t:WorkspaceCursors">WorkspaceCursors</a> l a</li><li class="src short"><span class="keyword">data</span> <a href="#t:WorkspaceCursors">WorkspaceCursors</a> a</li><li class="src short"><a href="#v:getFocus">getFocus</a> :: Cursors b -> b</li><li class="src short"><a href="#v:modifyLayer">modifyLayer</a> :: (Stack (Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>) -> Stack (Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>)) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> X <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:modifyLayer-39-">modifyLayer'</a> :: (Stack (Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>) -> X (Stack (Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>))) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> X <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:shiftModifyLayer">shiftModifyLayer</a> :: (Stack (Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>) -> Stack (Cursors WorkspaceId)) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> X <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:shiftLayer">shiftLayer</a> :: (Stack (Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>) -> Stack (Cursors WorkspaceId)) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> X <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:focusNth-39-">focusNth'</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> Stack a -> Stack a</li><li class="src short"><a href="#v:noWrapUp">noWrapUp</a> :: Stack t -> Stack t</li><li class="src short"><a href="#v:noWrapDown">noWrapDown</a> :: Stack t -> Stack t</li></ul></div><div id="interface"><h1 id="g:1">Usage </h1><div class="doc"><p>Here is an example config: </p><pre> 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 defaultConfig { layoutHook = workspaceCursors myCursors $ layoutHook defaultConfig , 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"]] </pre></div><div class="top"><p class="src"><a name="v:focusDepth" class="def">focusDepth</a> :: Cursors t -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a><a href="src/XMonad-Actions-WorkspaceCursors.html#focusDepth" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:makeCursors" class="def">makeCursors</a> :: [[<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>]] -> Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a><a href="src/XMonad-Actions-WorkspaceCursors.html#makeCursors" class="link">Source</a></p><div class="doc"><p>makeCursors requires a nonempty string, and each sublist must be nonempty </p></div></div><div class="top"><p class="src"><a name="v:toList" class="def">toList</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Foldable.html#t:Foldable">Foldable</a> t => t a -> [a]</p><div class="doc"><p>List of elements of a structure. </p></div></div><div class="top"><p class="src"><a name="v:workspaceCursors" class="def">workspaceCursors</a> :: Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> -> l a -> <a href="XMonad-Layout-LayoutModifier.html#t:ModifiedLayout">ModifiedLayout</a> <a href="XMonad-Actions-WorkspaceCursors.html#t:WorkspaceCursors">WorkspaceCursors</a> l a<a href="src/XMonad-Actions-WorkspaceCursors.html#workspaceCursors" class="link">Source</a></p><div class="doc"><p>The state is stored in the <code><a href="XMonad-Actions-WorkspaceCursors.html#t:WorkspaceCursors">WorkspaceCursors</a></code> layout modifier. Put this as your outermost modifier, unless you want different cursors at different times (using <a href="XMonad-Layout-MultiToggle.html">XMonad.Layout.MultiToggle</a>) </p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:WorkspaceCursors" class="def">WorkspaceCursors</a> a <a href="src/XMonad-Actions-WorkspaceCursors.html#WorkspaceCursors" class="link">Source</a></p><div class="subs instances"><p id="control.i:WorkspaceCursors" class="caption collapser" onclick="toggleSection('i:WorkspaceCursors')">Instances</p><div id="section.i:WorkspaceCursors" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Typeable.html#t:Typeable1">Typeable1</a> <a href="XMonad-Actions-WorkspaceCursors.html#t:WorkspaceCursors">WorkspaceCursors</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> <a href="XMonad-Actions-WorkspaceCursors.html#t:WorkspaceCursors">WorkspaceCursors</a> a</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Read.html#t:Read">Read</a> (<a href="XMonad-Actions-WorkspaceCursors.html#t:WorkspaceCursors">WorkspaceCursors</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (<a href="XMonad-Actions-WorkspaceCursors.html#t:WorkspaceCursors">WorkspaceCursors</a> a)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:getFocus" class="def">getFocus</a> :: Cursors b -> b<a href="src/XMonad-Actions-WorkspaceCursors.html#getFocus" class="link">Source</a></p></div><h1 id="g:2">Modifying the focus </h1><div class="top"><p class="src"><a name="v:modifyLayer" class="def">modifyLayer</a> :: (Stack (Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>) -> Stack (Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>)) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> X <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/XMonad-Actions-WorkspaceCursors.html#modifyLayer" class="link">Source</a></p><div class="doc"><p><code>modifyLayer</code> is used to change the focus at a given depth </p></div></div><div class="top"><p class="src"><a name="v:modifyLayer-39-" class="def">modifyLayer'</a> :: (Stack (Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>) -> X (Stack (Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>))) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> X <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/XMonad-Actions-WorkspaceCursors.html#modifyLayer%27" class="link">Source</a></p><div class="doc"><p>example usages are <code><a href="XMonad-Actions-WorkspaceCursors.html#v:shiftLayer">shiftLayer</a></code> and <code><a href="XMonad-Actions-WorkspaceCursors.html#v:shiftModifyLayer">shiftModifyLayer</a></code> </p></div></div><div class="top"><p class="src"><a name="v:shiftModifyLayer" class="def">shiftModifyLayer</a> :: (Stack (Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>) -> Stack (Cursors WorkspaceId)) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> X <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/XMonad-Actions-WorkspaceCursors.html#shiftModifyLayer" class="link">Source</a></p><div class="doc"><p><code>shiftModifyLayer</code> is the same as <code><a href="XMonad-Actions-WorkspaceCursors.html#v:modifyLayer">modifyLayer</a></code>, but also shifts the currently focused window to the new workspace </p></div></div><div class="top"><p class="src"><a name="v:shiftLayer" class="def">shiftLayer</a> :: (Stack (Cursors <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>) -> Stack (Cursors WorkspaceId)) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> X <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/XMonad-Actions-WorkspaceCursors.html#shiftLayer" class="link">Source</a></p><div class="doc"><p><code>shiftLayer</code> is the same as <code><a href="XMonad-Actions-WorkspaceCursors.html#v:shiftModifyLayer">shiftModifyLayer</a></code>, but the focus remains on the current workspace. </p></div></div><h1 id="g:3">Functions to pass to <code><a href="XMonad-Actions-WorkspaceCursors.html#v:modifyLayer">modifyLayer</a></code> </h1><div class="top"><p class="src"><a name="v:focusNth-39-" class="def">focusNth'</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> Stack a -> Stack a<a href="src/XMonad-Actions-FocusNth.html#focusNth%27" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:noWrapUp" class="def">noWrapUp</a> :: Stack t -> Stack t<a href="src/XMonad-Actions-WorkspaceCursors.html#noWrapUp" class="link">Source</a></p><div class="doc"><p>non-wrapping version of <code>focusUp'</code> </p></div></div><div class="top"><p class="src"><a name="v:noWrapDown" class="def">noWrapDown</a> :: Stack t -> Stack t<a href="src/XMonad-Actions-WorkspaceCursors.html#noWrapDown" class="link">Source</a></p><div class="doc"><p>non-wrapping version of <code>focusDown'</code> </p></div></div><h1 id="g:4">Todo </h1><div class="doc"><ul><li> Find and document how to raise the allowable length of arguments: restoring xmonad's state results in: <code>xmonad: executeFile: resource exhausted (Argument list too long)</code> when you specify more than about 50 workspaces. Or change it such that workspaces are created when you try to view it. </li><li> Function for pretty printing for DynamicLog that groups workspaces by common prefixes </li><li> Examples of adding workspaces to the cursors, having them appear multiple times for being able to show jumping to some n'th multiple workspace </li></ul></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>