Sophie

Sophie

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

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.Util.CustomKeys</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-Util-CustomKeys.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-Util-CustomKeys.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.Util.CustomKeys</FONT
></TD
><TD ALIGN="right"
><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="infohead"
>Maintainer</TD
><TD CLASS="infoval"
>Valery V. Vorotynsev &lt;valery.vv@gmail.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"
><P
>Customized key bindings.
</P
><P
>(See also <A HREF="XMonad-Util-EZConfig.html"
>XMonad.Util.EZConfig</A
> in xmonad-contrib.)
</P
></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"
><A HREF="#v%3AcustomKeys"
>customKeys</A
> :: (<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AXConfig"
>XConfig</A
> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3ALayout"
>Layout</A
> -&gt; [(<A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeyMask"
>KeyMask</A
>, <A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeySym"
>KeySym</A
>)]) -&gt; (<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AXConfig"
>XConfig</A
> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3ALayout"
>Layout</A
> -&gt; [((<A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeyMask"
>KeyMask</A
>, <A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeySym"
>KeySym</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
>)]) -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AXConfig"
>XConfig</A
> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3ALayout"
>Layout</A
> -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/containers-0.3.0.0/Data-Map.html#t%3AMap"
>Map</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeyMask"
>KeyMask</A
>, <A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeySym"
>KeySym</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%3AcustomKeysFrom"
>customKeysFrom</A
> ::  <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AXConfig"
>XConfig</A
> l -&gt; (<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AXConfig"
>XConfig</A
> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3ALayout"
>Layout</A
> -&gt; [(<A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeyMask"
>KeyMask</A
>, <A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeySym"
>KeySym</A
>)]) -&gt; (<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AXConfig"
>XConfig</A
> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3ALayout"
>Layout</A
> -&gt; [((<A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeyMask"
>KeyMask</A
>, <A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeySym"
>KeySym</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
>)]) -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AXConfig"
>XConfig</A
> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3ALayout"
>Layout</A
> -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/containers-0.3.0.0/Data-Map.html#t%3AMap"
>Map</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeyMask"
>KeyMask</A
>, <A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeySym"
>KeySym</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
>1. In <TT
>~/.xmonad/xmonad.hs</TT
> add:
</P
><PRE
> import XMonad.Util.CustomKeys
</PRE
><P
>2. Set key bindings with <TT
><A HREF="XMonad-Util-CustomKeys.html#v%3AcustomKeys"
>customKeys</A
></TT
>:
</P
><PRE
> main = xmonad defaultConfig { keys = customKeys delkeys inskeys }
     where
       delkeys :: XConfig l -&gt; [(KeyMask, KeySym)]
       delkeys XConfig {modMask = modm} =
           -- we're preferring Futurama to Xinerama here
           [ (modm .|. m, k) | (m, k) &lt;- zip [0, shiftMask] [xK_w, xK_e, xK_r] ]

       inskeys :: XConfig l -&gt; [((KeyMask, KeySym), X ())]
       inskeys conf@(XConfig {modMask = modm}) =
           [ ((mod1Mask,             xK_F2  ), spawn $ terminal conf)
           , ((modm .|. controlMask, xK_F11 ), spawn &quot;xscreensaver-command -lock&quot;)
           , ((mod1Mask,             xK_Down), spawn &quot;amixer set Master 1-&quot;)
           , ((mod1Mask,             xK_Up  ), spawn &quot;amixer set Master 1+&quot;)
           ]
</PRE
><P
>0 (<EM
>hidden feature</EM
>). You can always replace bindings map
   entirely. No need to import <A HREF="CustomKeys.html"
>CustomKeys</A
> this time:
</P
><PRE
> import XMonad
 import System.Exit
 import qualified Data.Map as M

 main = xmonad defaultConfig {
          keys = \_ -&gt; M.fromList [
                  -- Let me out of here! I want my KDE back! Help! Help!
                  ( (0, xK_Escape), io (exitWith ExitSuccess) ) ] }
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:customKeys"
><A NAME="v%3AcustomKeys"
></A
></A
><B
>customKeys</B
></TD
><TD CLASS="declbut"
><A HREF="src/XMonad-Util-CustomKeys.html#customKeys"
>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%3AXConfig"
>XConfig</A
> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3ALayout"
>Layout</A
> -&gt; [(<A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeyMask"
>KeyMask</A
>, <A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeySym"
>KeySym</A
>)]</TD
><TD CLASS="rdoc"
>shortcuts to delete
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AXConfig"
>XConfig</A
> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3ALayout"
>Layout</A
> -&gt; [((<A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeyMask"
>KeyMask</A
>, <A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeySym"
>KeySym</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="rdoc"
>key bindings to insert
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AXConfig"
>XConfig</A
> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3ALayout"
>Layout</A
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="/usr/share/doc/ghc/html/libraries/containers-0.3.0.0/Data-Map.html#t%3AMap"
>Map</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeyMask"
>KeyMask</A
>, <A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeySym"
>KeySym</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="rdoc"
></TD
></TR
><TR
><TD CLASS="ndoc" COLSPAN="2"
>Customize XMonad.Config.defaultConfig -- delete needless
 shortcuts and insert those you will use.
</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:customKeysFrom"
><A NAME="v%3AcustomKeysFrom"
></A
></A
><B
>customKeysFrom</B
></TD
><TD CLASS="declbut"
><A HREF="src/XMonad-Util-CustomKeys.html#customKeysFrom"
>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%3AXConfig"
>XConfig</A
> l</TD
><TD CLASS="rdoc"
>original configuration
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AXConfig"
>XConfig</A
> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3ALayout"
>Layout</A
> -&gt; [(<A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeyMask"
>KeyMask</A
>, <A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeySym"
>KeySym</A
>)]</TD
><TD CLASS="rdoc"
>shortcuts to delete
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AXConfig"
>XConfig</A
> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3ALayout"
>Layout</A
> -&gt; [((<A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeyMask"
>KeyMask</A
>, <A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeySym"
>KeySym</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="rdoc"
>key bindings to insert
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AXConfig"
>XConfig</A
> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3ALayout"
>Layout</A
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="/usr/share/doc/ghc/html/libraries/containers-0.3.0.0/Data-Map.html#t%3AMap"
>Map</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeyMask"
>KeyMask</A
>, <A HREF="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t%3AKeySym"
>KeySym</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="rdoc"
></TD
></TR
><TR
><TD CLASS="ndoc" COLSPAN="2"
>General variant of <TT
><A HREF="XMonad-Util-CustomKeys.html#v%3AcustomKeys"
>customKeys</A
></TT
>: customize key bindings of
 third-party configuration.
</TD
></TR
></TABLE
></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
>