Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 420a649e6f65db30aa7451f64d08ff92 > files > 651

ghc-xmonad-contrib-devel-0.9.2-4.fc16.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.Layout.IndependentScreens</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-Layout-IndependentScreens.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/XMonad-Layout-IndependentScreens.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>&lt;daniel@wagner-home.com&gt;</td></tr></table><p class="caption">XMonad.Layout.IndependentScreens</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Usage
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Utility functions for simulating independent sets of workspaces on
 each screen (like dwm's workspace model), using internal tags to
 distinguish workspaces associated with each screen.
</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"><span class="keyword">type</span> <a href="#t:VirtualWorkspace">VirtualWorkspace</a> = WorkspaceId</li><li class="src short"><span class="keyword">type</span> <a href="#t:PhysicalWorkspace">PhysicalWorkspace</a> = WorkspaceId</li><li class="src short"><a href="#v:workspaces-39-">workspaces'</a> ::  XConfig l -&gt; [<a href="XMonad-Layout-IndependentScreens.html#t:VirtualWorkspace">VirtualWorkspace</a>]</li><li class="src short"><a href="#v:withScreens">withScreens</a> :: ScreenId -&gt; [<a href="XMonad-Layout-IndependentScreens.html#t:VirtualWorkspace">VirtualWorkspace</a>] -&gt; [<a href="XMonad-Layout-IndependentScreens.html#t:PhysicalWorkspace">PhysicalWorkspace</a>]</li><li class="src short"><a href="#v:onCurrentScreen">onCurrentScreen</a> ::  (<a href="XMonad-Layout-IndependentScreens.html#t:VirtualWorkspace">VirtualWorkspace</a> -&gt; WindowSet -&gt; a) -&gt; <a href="XMonad-Layout-IndependentScreens.html#t:PhysicalWorkspace">PhysicalWorkspace</a> -&gt; WindowSet -&gt; a</li><li class="src short"><a href="#v:countScreens">countScreens</a> :: (<a href="/usr/share/doc/ghc/html/libraries/transformers-0.2.2.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Integral">Integral</a> i) =&gt; m i</li><li class="src short"><a href="#v:marshall">marshall</a> :: ScreenId -&gt; <a href="XMonad-Layout-IndependentScreens.html#t:VirtualWorkspace">VirtualWorkspace</a> -&gt; <a href="XMonad-Layout-IndependentScreens.html#t:PhysicalWorkspace">PhysicalWorkspace</a></li><li class="src short"><a href="#v:unmarshall">unmarshall</a> :: <a href="XMonad-Layout-IndependentScreens.html#t:PhysicalWorkspace">PhysicalWorkspace</a> -&gt; (ScreenId, <a href="XMonad-Layout-IndependentScreens.html#t:VirtualWorkspace">VirtualWorkspace</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>:
</p><pre> import XMonad.Layout.IndependentScreens
</pre><p>You can define your workspaces by calling <code>withScreens</code>:
</p><pre> myConfig = defaultConfig { workspaces = withScreens 2 [&quot;web&quot;, &quot;email&quot;, &quot;irc&quot;] }
</pre><p>This will create &quot;physical&quot; workspaces with distinct internal names for
 each (screen, virtual workspace) pair.
</p><p>Then edit any keybindings that use the list of workspaces or refer
 to specific workspace names.  In the default configuration, only
 the keybindings for changing workspace do this:
</p><pre> [((m .|. modm, k), windows $ f i)
     | (i, k) &lt;- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
     , (f, m) &lt;- [(W.greedyView, 0), (W.shift, shiftMask)]]
</pre><p>This should change to
</p><pre> [((m .|. modm, k), windows $ onCurrentScreen f i)
     | (i, k) &lt;- zip (workspaces' conf) [xK_1 .. xK_9]
     , (f, m) &lt;- [(W.greedyView, 0), (W.shift, shiftMask)]]
</pre><p>In particular, the analogue of <code>XMonad.workspaces</code> is
 <code>workspaces'</code>, and you can use <code>onCurrentScreen</code> to convert functions
 of virtual workspaces to functions of physical workspaces, which work
 by marshalling the virtual workspace name and the currently focused
 screen into a physical workspace name.
</p></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:VirtualWorkspace" class="def">VirtualWorkspace</a> = WorkspaceId<a href="src/XMonad-Layout-IndependentScreens.html#VirtualWorkspace" class="link">Source</a></p></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:PhysicalWorkspace" class="def">PhysicalWorkspace</a> = WorkspaceId<a href="src/XMonad-Layout-IndependentScreens.html#PhysicalWorkspace" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:workspaces-39-" class="def">workspaces'</a> ::  XConfig l -&gt; [<a href="XMonad-Layout-IndependentScreens.html#t:VirtualWorkspace">VirtualWorkspace</a>]<a href="src/XMonad-Layout-IndependentScreens.html#workspaces%27" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:withScreens" class="def">withScreens</a><a href="src/XMonad-Layout-IndependentScreens.html#withScreens" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: ScreenId</td><td class="doc"><p>The number of screens to make workspaces for
</p></td></tr><tr><td class="src">-&gt; [<a href="XMonad-Layout-IndependentScreens.html#t:VirtualWorkspace">VirtualWorkspace</a>]</td><td class="doc"><p>The desired virtual workspace names
</p></td></tr><tr><td class="src">-&gt; [<a href="XMonad-Layout-IndependentScreens.html#t:PhysicalWorkspace">PhysicalWorkspace</a>]</td><td class="doc"><p>A list of all internal physical workspace names
</p></td></tr></table></div></div><div class="top"><p class="src"><a name="v:onCurrentScreen" class="def">onCurrentScreen</a> ::  (<a href="XMonad-Layout-IndependentScreens.html#t:VirtualWorkspace">VirtualWorkspace</a> -&gt; WindowSet -&gt; a) -&gt; <a href="XMonad-Layout-IndependentScreens.html#t:PhysicalWorkspace">PhysicalWorkspace</a> -&gt; WindowSet -&gt; a<a href="src/XMonad-Layout-IndependentScreens.html#onCurrentScreen" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:countScreens" class="def">countScreens</a> :: (<a href="/usr/share/doc/ghc/html/libraries/transformers-0.2.2.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Integral">Integral</a> i) =&gt; m i<a href="src/XMonad-Layout-IndependentScreens.html#countScreens" class="link">Source</a></p><div class="doc"><p>In case you don't know statically how many screens there will be, you can call this in main before starting xmonad.  For example, part of my config reads
</p><pre> main = do
   nScreens &lt;- countScreens
   xmonad $ defaultConfig {
     ...
     workspaces = withScreens nScreens (workspaces defaultConfig),
     ...
     }
</pre></div></div><div class="top"><p class="src"><a name="v:marshall" class="def">marshall</a> :: ScreenId -&gt; <a href="XMonad-Layout-IndependentScreens.html#t:VirtualWorkspace">VirtualWorkspace</a> -&gt; <a href="XMonad-Layout-IndependentScreens.html#t:PhysicalWorkspace">PhysicalWorkspace</a><a href="src/XMonad-Layout-IndependentScreens.html#marshall" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:unmarshall" class="def">unmarshall</a> :: <a href="XMonad-Layout-IndependentScreens.html#t:PhysicalWorkspace">PhysicalWorkspace</a> -&gt; (ScreenId, <a href="XMonad-Layout-IndependentScreens.html#t:VirtualWorkspace">VirtualWorkspace</a>)<a href="src/XMonad-Layout-IndependentScreens.html#unmarshall" class="link">Source</a></p><div class="doc"><p>You shouldn't need to use <code>marshall</code> and <code>unmarshall</code> very much.
 They simply convert between the physical and virtual worlds.  For
 example, you might want to use them as part of a status bar
 configuration.  The function <code>snd . unmarshall</code> would discard the
 screen information from an otherwise unsightly workspace name.
</p></div></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>