Sophie

Sophie

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

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.Hooks.Place</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-Hooks-Place.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/XMonad-Hooks-Place.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>orphaned</td></tr><tr><th>Safe Haskell</th><td>Safe-Infered</td></tr></table><p class="caption">XMonad.Hooks.Place</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">Placement actions
</a></li><li><a href="#g:3">Placement policies
</a></li><li><a href="#g:4">Others
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Automatic placement of floating windows.
</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:placeFocused">placeFocused</a> :: <a href="XMonad-Hooks-Place.html#t:Placement">Placement</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:placeHook">placeHook</a> :: <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ManageHook">ManageHook</a></li><li class="src short"><span class="keyword">data</span>  <a href="#t:Placement">Placement</a> </li><li class="src short"><a href="#v:smart">smart</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Prelude.html#t:Rational">Rational</a>, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Prelude.html#t:Rational">Rational</a>) -&gt; <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></li><li class="src short"><a href="#v:simpleSmart">simpleSmart</a> :: <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></li><li class="src short"><a href="#v:fixed">fixed</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Prelude.html#t:Rational">Rational</a>, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Prelude.html#t:Rational">Rational</a>) -&gt; <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></li><li class="src short"><a href="#v:underMouse">underMouse</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Prelude.html#t:Rational">Rational</a>, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Prelude.html#t:Rational">Rational</a>) -&gt; <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></li><li class="src short"><a href="#v:inBounds">inBounds</a> :: <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a> -&gt; <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></li><li class="src short"><a href="#v:withGaps">withGaps</a> :: (<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Dimension">Dimension</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Dimension">Dimension</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Dimension">Dimension</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Dimension">Dimension</a>) -&gt; <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a> -&gt; <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></li><li class="src short"><a href="#v:purePlaceWindow">purePlaceWindow</a> :: <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Rectangle">Rectangle</a> -&gt; [<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Rectangle">Rectangle</a>] -&gt; (<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Position">Position</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Position">Position</a>) -&gt; <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Rectangle">Rectangle</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Rectangle">Rectangle</a></li></ul></div><div id="interface"><h1 id="g:1">Usage
</h1><div class="doc"><p>This module provides a <code><a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ManageHook">ManageHook</a></code> that automatically places
 floating windows at appropriate positions on the screen, as well
 as an <code><a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a></code> action to manually trigger repositioning.
</p><p>You can use this module by including the following in your <code>~/.xmonad/xmonad.hs</code>:
</p><pre> import XMonad.Hooks.Place
</pre><p>and adding <code><a href="XMonad-Hooks-Place.html#v:placeHook">placeHook</a></code> to your <code><a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#v:manageHook">manageHook</a></code>, for example:
</p><pre> main = xmonad $ defaultConfig { manageHook = placeHook simpleSmart
                                              &lt;+&gt; manageHook defaultConfig }
</pre><p>Note that <code><a href="XMonad-Hooks-Place.html#v:placeHook">placeHook</a></code> should be applied after most other hooks, especially hooks
 such as <code><a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-ManageHook.html#v:doFloat">doFloat</a></code> and <code><a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-ManageHook.html#v:doShift">doShift</a></code>. Since hooks combined with <code><a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-ManageHook.html#v:-60--43--62-">&lt;+&gt;</a></code> are applied from
 right to left, this means that <code><a href="XMonad-Hooks-Place.html#v:placeHook">placeHook</a></code> should be the <em>first</em> hook in your chain.
</p><p>You can also define a key to manually trigger repositioning with <code><a href="XMonad-Hooks-Place.html#v:placeFocused">placeFocused</a></code> by
 adding the following to your keys definition:
</p><pre> , ((modm, xK_w), placeFocused simpleSmart)
</pre><p>Both <code><a href="XMonad-Hooks-Place.html#v:placeHook">placeHook</a></code> and <code><a href="XMonad-Hooks-Place.html#v:placeFocused">placeFocused</a></code> take a <code><a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></code> parameter, which specifies
 the placement policy to use (smart, under the mouse, fixed position, etc.). See
 <code><a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></code> for a list of available policies.
</p></div><h1 id="g:2">Placement actions
</h1><div class="top"><p class="src"><a name="v:placeFocused" class="def">placeFocused</a> :: <a href="XMonad-Hooks-Place.html#t:Placement">Placement</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><a href="src/XMonad-Hooks-Place.html#placeFocused" class="link">Source</a></p><div class="doc"><p>Repositions the focused window according to a placement policy. Works for
 both &quot;real&quot; floating windows and windows in a <code><a href="XMonad-Layout-WindowArranger.html#t:WindowArranger">WindowArranger</a></code>-based
 layout.
</p></div></div><div class="top"><p class="src"><a name="v:placeHook" class="def">placeHook</a> :: <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ManageHook">ManageHook</a><a href="src/XMonad-Hooks-Place.html#placeHook" class="link">Source</a></p><div class="doc"><p>Hook to automatically place windows when they are created.
</p></div></div><h1 id="g:3">Placement policies
</h1><div class="doc"><p>Placement policies determine how windows will be placed by <code><a href="XMonad-Hooks-Place.html#v:placeFocused">placeFocused</a></code> and <code><a href="XMonad-Hooks-Place.html#v:placeHook">placeHook</a></code>.
</p><p>A few examples:
</p><ul><li> Basic smart placement
</li></ul><pre> myPlacement = simpleSmart
</pre><ul><li> Under the mouse (pointer at the top-left corner), but constrained
   inside of the screen area
</li></ul><pre> myPlacement = inBounds (underMouse (0, 0))
</pre><ul><li> Smart placement with a preference for putting windows near
 the center of the screen, and with 16px gaps at the top and bottom
 of the screen where no window will be placed
</li></ul><pre> myPlacement = withGaps (16,0,16,0) (smart (0.5,0.5))
</pre></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Placement" class="def">Placement</a>  <a href="src/XMonad-Hooks-Place.html#Placement" class="link">Source</a></p><div class="doc"><p>The type of placement policies
</p></div><div class="subs instances"><p id="control.i:Placement" class="caption collapser" onclick="toggleSection('i:Placement')">Instances</p><div id="section.i:Placement" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Text-Read.html#t:Read">Read</a> <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Text-Show.html#t:Show">Show</a> <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:smart" class="def">smart</a><a href="src/XMonad-Hooks-Place.html#smart" 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/base-4.5.0.0/Prelude.html#t:Rational">Rational</a>, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Prelude.html#t:Rational">Rational</a>)</td><td class="doc"><p>Where the window should be placed inside
 the available area. See <code><a href="XMonad-Hooks-Place.html#v:fixed">fixed</a></code>.
</p></td></tr><tr><td class="src">-&gt; <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Try to place windows with as little overlap as possible
</p></div></div><div class="top"><p class="src"><a name="v:simpleSmart" class="def">simpleSmart</a> :: <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a><a href="src/XMonad-Hooks-Place.html#simpleSmart" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:fixed" class="def">fixed</a><a href="src/XMonad-Hooks-Place.html#fixed" 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/base-4.5.0.0/Prelude.html#t:Rational">Rational</a>, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Prelude.html#t:Rational">Rational</a>)</td><td class="doc"><p>Where windows should go.
</p><ul><li> (0,0) -&gt; top left of the screen
</li><li> (1,0) -&gt; top right of the screen
</li><li> etc
</li></ul></td></tr><tr><td class="src">-&gt; <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Place windows at a fixed position
</p></div></div><div class="top"><p class="src"><a name="v:underMouse" class="def">underMouse</a><a href="src/XMonad-Hooks-Place.html#underMouse" 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/base-4.5.0.0/Prelude.html#t:Rational">Rational</a>, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Prelude.html#t:Rational">Rational</a>)</td><td class="doc"><p>Where the pointer should be relative to
 the window's frame; see <code><a href="XMonad-Hooks-Place.html#v:fixed">fixed</a></code>.
</p></td></tr><tr><td class="src">-&gt; <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Place windows under the mouse
</p></div></div><div class="top"><p class="src"><a name="v:inBounds" class="def">inBounds</a> :: <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a> -&gt; <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a><a href="src/XMonad-Hooks-Place.html#inBounds" class="link">Source</a></p><div class="doc"><p>Apply the given placement policy, constraining the
 placed windows inside the screen boundaries.
</p></div></div><div class="top"><p class="src"><a name="v:withGaps" class="def">withGaps</a><a href="src/XMonad-Hooks-Place.html#withGaps" 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-Xlib-Types.html#t:Dimension">Dimension</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Dimension">Dimension</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Dimension">Dimension</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Dimension">Dimension</a>)</td><td class="doc"><p>top, right, bottom and left gaps
</p></td></tr><tr><td class="src">-&gt; <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Same as <code><a href="XMonad-Hooks-Place.html#v:inBounds">inBounds</a></code>, but allows specifying gaps along the screen's edges
</p></div></div><h1 id="g:4">Others
</h1><div class="top"><p class="src"><a name="v:purePlaceWindow" class="def">purePlaceWindow</a><a href="src/XMonad-Hooks-Place.html#purePlaceWindow" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="XMonad-Hooks-Place.html#t:Placement">Placement</a></td><td class="doc"><p>The placement strategy
</p></td></tr><tr><td class="src">-&gt; <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Rectangle">Rectangle</a></td><td class="doc"><p>The screen
</p></td></tr><tr><td class="src">-&gt; [<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Rectangle">Rectangle</a>]</td><td class="doc"><p>The other visible windows
</p></td></tr><tr><td class="src">-&gt; (<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Position">Position</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Position">Position</a>)</td><td class="doc"><p>The pointer's position.
</p></td></tr><tr><td class="src">-&gt; <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Rectangle">Rectangle</a></td><td class="doc"><p>The window to be placed
</p></td></tr><tr><td class="src">-&gt; <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Rectangle">Rectangle</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Compute the new position of a window according to a placement policy.
</p></div></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>