xmonad-contrib-0.18.1: Community-maintained extensions for xmonad
Copyright(c) 2007 Valery V. Vorotyntsev
LicenseBSD3-style (see LICENSE)
Safe HaskellSafe-Inferred
LanguageHaskell2010

XMonad.Util.CustomKeys

Contents

Description

Customized key bindings.

See also XMonad.Util.EZConfig in xmonad-contrib.

Synopsis

Usage

In xmonad.hs add:

import XMonad.Util.CustomKeys

Set key bindings with customKeys:

main = xmonad def { keys = customKeys delkeys inskeys }
    where
      delkeys :: XConfig l -> [(KeyMask, KeySym)]
      delkeys XConfig {modMask = modm} =
          [ (modm .|. shiftMask, xK_Return) -- > terminal
          , (modm .|. shiftMask, xK_c)      -- > close the focused window
          ]
          ++
          [ (modm .|. m, k) | m <- [0, shiftMask], k <- [xK_w, xK_e, xK_r] ]

      inskeys :: XConfig l -> [((KeyMask, KeySym), X ())]
      inskeys conf@(XConfig {modMask = modm}) =
          [ ((mod1Mask,             xK_F2  ), spawn $ terminal conf) -- mod1-f2 %! Run a terminal emulator
          , ((modm,                 xK_Delete), kill) -- %! Close the focused window
          , ((modm .|. controlMask, xK_F11 ), spawn "xscreensaver-command -lock")
          , ((mod1Mask,             xK_Down), spawn "amixer set Master 1-")
          , ((mod1Mask,             xK_Up  ), spawn "amixer set Master 1+")
          ]

customKeys Source #

Arguments

:: (XConfig Layout -> [(KeyMask, KeySym)])

shortcuts to delete

-> (XConfig Layout -> [((KeyMask, KeySym), X ())])

key bindings to insert

-> XConfig Layout 
-> Map (KeyMask, KeySym) (X ()) 

Customize def -- delete needless shortcuts and insert those you will use.

customKeysFrom Source #

Arguments

:: XConfig l

original configuration

-> (XConfig Layout -> [(KeyMask, KeySym)])

shortcuts to delete

-> (XConfig Layout -> [((KeyMask, KeySym), X ())])

key bindings to insert

-> XConfig Layout 
-> Map (KeyMask, KeySym) (X ()) 

General variant of customKeys: customize key bindings of third-party configuration.