Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 97b7e04d4a67814e1160568251f09714 > files > 470

ghc-xmonad-contrib-devel-0.9.1-8.fc14.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--Rendered using the Haskell Html Library v0.2-->
<HTML
><HEAD
><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"
><TITLE
>XMonad.Layout.IndependentScreens</TITLE
><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css"
><SCRIPT SRC="haddock-util.js" TYPE="text/javascript"
></SCRIPT
><SCRIPT TYPE="text/javascript"
>window.onload = function () {setSynopsis("mini_XMonad-Layout-IndependentScreens.html")};</SCRIPT
></HEAD
><BODY
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="topbar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" "
></TD
><TD CLASS="title"
>xmonad-contrib-0.9.1: Third party extensions for xmonad</TD
><TD CLASS="topbut"
><A HREF="src/XMonad-Layout-IndependentScreens.html"
>Source code</A
></TD
><TD CLASS="topbut"
><A HREF="index.html"
>Contents</A
></TD
><TD CLASS="topbut"
><A HREF="doc-index.html"
>Index</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="modulebar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><FONT SIZE="6"
>XMonad.Layout.IndependentScreens</FONT
></TD
><TD ALIGN="right"
><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="infohead"
>Portability</TD
><TD CLASS="infoval"
>unportable</TD
></TR
><TR
><TD CLASS="infohead"
>Stability</TD
><TD CLASS="infoval"
>unstable</TD
></TR
><TR
><TD CLASS="infohead"
>Maintainer</TD
><TD CLASS="infoval"
>&lt;daniel@wagner-home.com&gt;</TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="section4"
><B
>Contents</B
></TD
></TR
><TR
><TD
><DL
><DT
><A HREF="#1"
>Usage
</A
></DT
></DL
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Description</TD
></TR
><TR
><TD CLASS="doc"
>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.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Synopsis</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>type</SPAN
> <A HREF="#t%3AVirtualWorkspace"
>VirtualWorkspace</A
> = <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWorkspaceId"
>WorkspaceId</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>type</SPAN
> <A HREF="#t%3APhysicalWorkspace"
>PhysicalWorkspace</A
> = <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWorkspaceId"
>WorkspaceId</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aworkspaces%27"
>workspaces'</A
> ::  <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AXConfig"
>XConfig</A
> l -&gt; [<A HREF="XMonad-Layout-IndependentScreens.html#t%3AVirtualWorkspace"
>VirtualWorkspace</A
>]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AwithScreens"
>withScreens</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AScreenId"
>ScreenId</A
> -&gt; [<A HREF="XMonad-Layout-IndependentScreens.html#t%3AVirtualWorkspace"
>VirtualWorkspace</A
>] -&gt; [<A HREF="XMonad-Layout-IndependentScreens.html#t%3APhysicalWorkspace"
>PhysicalWorkspace</A
>]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AonCurrentScreen"
>onCurrentScreen</A
> ::  (<A HREF="XMonad-Layout-IndependentScreens.html#t%3AVirtualWorkspace"
>VirtualWorkspace</A
> -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWindowSet"
>WindowSet</A
> -&gt; a) -&gt; <A HREF="XMonad-Layout-IndependentScreens.html#t%3APhysicalWorkspace"
>PhysicalWorkspace</A
> -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWindowSet"
>WindowSet</A
> -&gt; a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AcountScreens"
>countScreens</A
> :: (<A HREF="/usr/share/doc/ghc/html/libraries/mtl-1.1.0.2/Control-Monad-Trans.html#t%3AMonadIO"
>MonadIO</A
> m, <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3AIntegral"
>Integral</A
> i) =&gt; m i</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Amarshall"
>marshall</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AScreenId"
>ScreenId</A
> -&gt; <A HREF="XMonad-Layout-IndependentScreens.html#t%3AVirtualWorkspace"
>VirtualWorkspace</A
> -&gt; <A HREF="XMonad-Layout-IndependentScreens.html#t%3APhysicalWorkspace"
>PhysicalWorkspace</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aunmarshall"
>unmarshall</A
> :: <A HREF="XMonad-Layout-IndependentScreens.html#t%3APhysicalWorkspace"
>PhysicalWorkspace</A
> -&gt; (<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AScreenId"
>ScreenId</A
>, <A HREF="XMonad-Layout-IndependentScreens.html#t%3AVirtualWorkspace"
>VirtualWorkspace</A
>)</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="1"
><A NAME="1"
>Usage
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="doc"
><P
>You can use this module with the following in your <TT
>~/.xmonad/xmonad.hs</TT
>:
</P
><PRE
> import XMonad.Layout.IndependentScreens
</PRE
><P
>You can define your workspaces by calling <TT
>withScreens</TT
>:
</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 <TT
>XMonad.workspaces</TT
> is
 <TT
>workspaces'</TT
>, and you can use <TT
>onCurrentScreen</TT
> 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><SPAN CLASS="keyword"
>type</SPAN
> <A NAME="t:VirtualWorkspace"
><A NAME="t%3AVirtualWorkspace"
></A
></A
><B
>VirtualWorkspace</B
> = <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWorkspaceId"
>WorkspaceId</A
></TD
><TD CLASS="declbut"
><A HREF="src/XMonad-Layout-IndependentScreens.html#VirtualWorkspace"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><SPAN CLASS="keyword"
>type</SPAN
> <A NAME="t:PhysicalWorkspace"
><A NAME="t%3APhysicalWorkspace"
></A
></A
><B
>PhysicalWorkspace</B
> = <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWorkspaceId"
>WorkspaceId</A
></TD
><TD CLASS="declbut"
><A HREF="src/XMonad-Layout-IndependentScreens.html#PhysicalWorkspace"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:workspaces'"
><A NAME="v%3Aworkspaces%27"
></A
></A
><B
>workspaces'</B
> ::  <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AXConfig"
>XConfig</A
> l -&gt; [<A HREF="XMonad-Layout-IndependentScreens.html#t%3AVirtualWorkspace"
>VirtualWorkspace</A
>]</TD
><TD CLASS="declbut"
><A HREF="src/XMonad-Layout-IndependentScreens.html#workspaces%27"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:withScreens"
><A NAME="v%3AwithScreens"
></A
></A
><B
>withScreens</B
></TD
><TD CLASS="declbut"
><A HREF="src/XMonad-Layout-IndependentScreens.html#withScreens"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="arg"
>:: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AScreenId"
>ScreenId</A
></TD
><TD CLASS="rdoc"
>The number of screens to make workspaces for
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; [<A HREF="XMonad-Layout-IndependentScreens.html#t%3AVirtualWorkspace"
>VirtualWorkspace</A
>]</TD
><TD CLASS="rdoc"
>The desired virtual workspace names
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; [<A HREF="XMonad-Layout-IndependentScreens.html#t%3APhysicalWorkspace"
>PhysicalWorkspace</A
>]</TD
><TD CLASS="rdoc"
>A list of all internal physical workspace names
</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:onCurrentScreen"
><A NAME="v%3AonCurrentScreen"
></A
></A
><B
>onCurrentScreen</B
> ::  (<A HREF="XMonad-Layout-IndependentScreens.html#t%3AVirtualWorkspace"
>VirtualWorkspace</A
> -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWindowSet"
>WindowSet</A
> -&gt; a) -&gt; <A HREF="XMonad-Layout-IndependentScreens.html#t%3APhysicalWorkspace"
>PhysicalWorkspace</A
> -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWindowSet"
>WindowSet</A
> -&gt; a</TD
><TD CLASS="declbut"
><A HREF="src/XMonad-Layout-IndependentScreens.html#onCurrentScreen"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:countScreens"
><A NAME="v%3AcountScreens"
></A
></A
><B
>countScreens</B
> :: (<A HREF="/usr/share/doc/ghc/html/libraries/mtl-1.1.0.2/Control-Monad-Trans.html#t%3AMonadIO"
>MonadIO</A
> m, <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3AIntegral"
>Integral</A
> i) =&gt; m i</TD
><TD CLASS="declbut"
><A HREF="src/XMonad-Layout-IndependentScreens.html#countScreens"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:marshall"
><A NAME="v%3Amarshall"
></A
></A
><B
>marshall</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AScreenId"
>ScreenId</A
> -&gt; <A HREF="XMonad-Layout-IndependentScreens.html#t%3AVirtualWorkspace"
>VirtualWorkspace</A
> -&gt; <A HREF="XMonad-Layout-IndependentScreens.html#t%3APhysicalWorkspace"
>PhysicalWorkspace</A
></TD
><TD CLASS="declbut"
><A HREF="src/XMonad-Layout-IndependentScreens.html#marshall"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:unmarshall"
><A NAME="v%3Aunmarshall"
></A
></A
><B
>unmarshall</B
> :: <A HREF="XMonad-Layout-IndependentScreens.html#t%3APhysicalWorkspace"
>PhysicalWorkspace</A
> -&gt; (<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AScreenId"
>ScreenId</A
>, <A HREF="XMonad-Layout-IndependentScreens.html#t%3AVirtualWorkspace"
>VirtualWorkspace</A
>)</TD
><TD CLASS="declbut"
><A HREF="src/XMonad-Layout-IndependentScreens.html#unmarshall"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>You shouldn't need to use <TT
>marshall</TT
> and <TT
>unmarshall</TT
> 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 <TT
>snd . unmarshall</TT
> would discard the
 screen information from an otherwise unsightly workspace name.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="botbar"
>Produced by <A HREF="http://www.haskell.org/haddock/"
>Haddock</A
> version 2.6.1</TD
></TR
></TABLE
></BODY
></HTML
>