<!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.Mosaic</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-Mosaic.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-Mosaic.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.Mosaic</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" >vogt.adam<at>gmail.com</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" >Based on MosaicAlt, but aspect ratio messages always change the aspect ratios, and rearranging the window stack changes the window sizes. </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" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A HREF="#t%3AAspect" >Aspect</A > </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" >= <A HREF="#v%3ATaller" >Taller</A ></TD ></TR ><TR ><TD CLASS="decl" >| <A HREF="#v%3AWider" >Wider</A ></TD ></TR ><TR ><TD CLASS="decl" >| <A HREF="#v%3AReset" >Reset</A ></TD ></TR ><TR ><TD CLASS="decl" >| <A HREF="#v%3ASlopeMod" >SlopeMod</A > ([<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A >] -> [<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A >])</TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3Amosaic" >mosaic</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A > -> [<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A >] -> Mosaic a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AchangeMaster" >changeMaster</A > :: (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A >) -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AchangeFocused" >changeFocused</A > :: (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A >) -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</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.Mosaic </PRE ><P >Then edit your <TT >layoutHook</TT > by adding the Mosaic layout: </P ><PRE > myLayout = mosaic 2 [3,2] ||| Full ||| etc.. main = xmonad $ defaultConfig { layoutHook = myLayout } </PRE ><P >Unfortunately, infinite lists break serialization, so don't use them. And if the list is too short, it is extended with <TT >++ repeat 1</TT >, which covers the main use case. </P ><P >To change the choice in aspect ratio and the relative sizes of windows, add to your keybindings: </P ><PRE > , ((modm, xK_a), sendMessage Taller) , ((modm, xK_z), sendMessage Wider) </PRE ><PRE > , ((modm, xK_r), sendMessage Reset) </PRE ><P >For more detailed instructions on editing the layoutHook see: </P ><P ><A HREF="XMonad-Doc-Extending.html#Editing_the_layout_hook" >XMonad.Doc.Extending</A > </P ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><SPAN CLASS="keyword" >data</SPAN > <A NAME="t:Aspect" ><A NAME="t%3AAspect" ></A ></A ><B >Aspect</B > </TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Layout-Mosaic.html#Aspect" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="section4" >Constructors</TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="arg" ><A NAME="v:Taller" ><A NAME="v%3ATaller" ></A ></A ><B >Taller</B ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:Wider" ><A NAME="v%3AWider" ></A ></A ><B >Wider</B ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:Reset" ><A NAME="v%3AReset" ></A ></A ><B >Reset</B ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:SlopeMod" ><A NAME="v%3ASlopeMod" ></A ></A ><B >SlopeMod</B > ([<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A >] -> [<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A >])</TD ><TD CLASS="rdoc" ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="section4" ><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Aspect')" ALT="show/hide" > Instances</TD ></TR ><TR ><TD CLASS="body" ><DIV ID="i:Aspect" STYLE="display:block;" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="decl" ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Typeable.html#t%3ATypeable" >Typeable</A > <A HREF="XMonad-Layout-Mosaic.html#t%3AAspect" >Aspect</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AMessage" >Message</A > <A HREF="XMonad-Layout-Mosaic.html#t%3AAspect" >Aspect</A ></TD ></TR ></TABLE ></DIV ></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:mosaic" ><A NAME="v%3Amosaic" ></A ></A ><B >mosaic</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A > -> [<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A >] -> Mosaic a</TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Layout-Mosaic.html#mosaic" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" ><P >The relative magnitudes (the sign is ignored) of the rational numbers in the second argument determine the relative areas that the windows receive. The first number represents the size of the master window, the second is for the next window in the stack, and so on. </P ><P >The list is extended with <TT >++ repeat 1</TT >, so <TT >mosaic 1.5 []</TT > is like a resizable grid. </P ><P >The first parameter is the multiplicative factor to use when responding to the <TT ><A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Layout.html#v%3AExpand" >Expand</A ></TT > message. </P ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:changeMaster" ><A NAME="v%3AchangeMaster" ></A ></A ><B >changeMaster</B > :: (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A >) -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Layout-Mosaic.html#changeMaster" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >These sample functions are meant to be applied to the list of window sizes through the <TT ><A HREF="XMonad-Layout-Mosaic.html#v%3ASlopeMod" >SlopeMod</A ></TT > message. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:changeFocused" ><A NAME="v%3AchangeFocused" ></A ></A ><B >changeFocused</B > :: (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ARational" >Rational</A >) -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Layout-Mosaic.html#changeFocused" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" ><P >Apply a function to the Rational that represents the currently focused window. </P ><P ><TT ><A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Layout.html#v%3AExpand" >Expand</A ></TT > and <TT ><A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Layout.html#v%3AShrink" >Shrink</A ></TT > messages are responded to with <TT >changeFocused (*delta)</TT > or <TT >changeFocused (delta/)</TT > where <TT >delta</TT > is the first argument to <TT ><A HREF="XMonad-Layout-Mosaic.html#v%3Amosaic" >mosaic</A ></TT >. </P ><P >This is exported because other functions (ex. <TT >const 1</TT >, <TT >(+1)</TT >) may be useful to apply to the current area. </P ></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 >