<!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.Util.CustomKeys</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-Util-CustomKeys.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/XMonad-Util-CustomKeys.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>Maintainer</th><td>Valery V. Vorotynsev <valery.vv@gmail.com></td></tr><tr><th>Safe Haskell</th><td>Safe-Infered</td></tr></table><p class="caption">XMonad.Util.CustomKeys</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>Customized key bindings. </p><p>(See also <a href="XMonad-Util-EZConfig.html">XMonad.Util.EZConfig</a> in xmonad-contrib.) </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:customKeys">customKeys</a> :: (<a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:Layout">Layout</a> -> [(<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeyMask">KeyMask</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>)]) -> (<a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:Layout">Layout</a> -> [((<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeyMask">KeyMask</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>), <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="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:Layout">Layout</a> -> <a href="/usr/share/doc/ghc/html/libraries/containers-0.4.2.1/Data-Map.html#t:Map">Map</a> (<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeyMask">KeyMask</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>) (<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:customKeysFrom">customKeysFrom</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> l -> (<a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:Layout">Layout</a> -> [(<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeyMask">KeyMask</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>)]) -> (<a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:Layout">Layout</a> -> [((<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeyMask">KeyMask</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>), <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="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:Layout">Layout</a> -> <a href="/usr/share/doc/ghc/html/libraries/containers-0.4.2.1/Data-Map.html#t:Map">Map</a> (<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeyMask">KeyMask</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>) (<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></ul></div><div id="interface"><h1 id="g:1">Usage </h1><div class="doc"><ol><li> In <code>~/.xmonad/xmonad.hs</code> add: </li></ol><pre> import XMonad.Util.CustomKeys </pre><ol><li> Set key bindings with <code><a href="XMonad-Util-CustomKeys.html#v:customKeys">customKeys</a></code>: </li></ol><pre> main = xmonad defaultConfig { keys = customKeys delkeys inskeys } where delkeys :: XConfig l -> [(KeyMask, KeySym)] delkeys XConfig {modMask = modm} = -- we're preferring Futurama to Xinerama here [ (modm .|. m, k) | (m, k) <- zip [0, shiftMask] [xK_w, xK_e, xK_r] ] inskeys :: XConfig l -> [((KeyMask, KeySym), X ())] inskeys conf@(XConfig {modMask = modm}) = [ ((mod1Mask, xK_F2 ), spawn $ terminal conf) , ((modm .|. controlMask, xK_F11 ), spawn "xscreensaver-command -lock") , ((mod1Mask, xK_Down), spawn "amixer set Master 1-") , ((mod1Mask, xK_Up ), spawn "amixer set Master 1+") ] </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 = \_ -> M.fromList [ -- Let me out of here! I want my KDE back! Help! Help! ( (0, xK_Escape), io (exitWith ExitSuccess) ) ] } </pre></div><div class="top"><p class="src"><a name="v:customKeys" class="def">customKeys</a><a href="src/XMonad-Util-CustomKeys.html#customKeys" 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/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:Layout">Layout</a> -> [(<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeyMask">KeyMask</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>)])</td><td class="doc"><p>shortcuts to delete </p></td></tr><tr><td class="src">-> (<a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:Layout">Layout</a> -> [((<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeyMask">KeyMask</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>), <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>)])</td><td class="doc"><p>key bindings to insert </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:Layout">Layout</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/containers-0.4.2.1/Data-Map.html#t:Map">Map</a> (<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeyMask">KeyMask</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>) (<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>)</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Customize <code><a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Config.html#v:defaultConfig">defaultConfig</a></code> -- delete needless shortcuts and insert those you will use. </p></div></div><div class="top"><p class="src"><a name="v:customKeysFrom" class="def">customKeysFrom</a><a href="src/XMonad-Util-CustomKeys.html#customKeysFrom" 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/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> l</td><td class="doc"><p>original configuration </p></td></tr><tr><td class="src">-> (<a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:Layout">Layout</a> -> [(<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeyMask">KeyMask</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>)])</td><td class="doc"><p>shortcuts to delete </p></td></tr><tr><td class="src">-> (<a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:Layout">Layout</a> -> [((<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeyMask">KeyMask</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>), <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>)])</td><td class="doc"><p>key bindings to insert </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:Layout">Layout</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/containers-0.4.2.1/Data-Map.html#t:Map">Map</a> (<a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeyMask">KeyMask</a>, <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:KeySym">KeySym</a>) (<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>)</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>General variant of <code><a href="XMonad-Util-CustomKeys.html#v:customKeys">customKeys</a></code>: customize key bindings of third-party configuration. </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>