xmonad-contrib-0.17.1: Community-maintained extensions for xmonad
Copyright(c) Wilson Sales 2019
LicenseBSD3-style (see LICENSE)
MaintainerWilson Sales <spoonm@spoonm.org>
Stabilityunstable
Portabilityunportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

XMonad.Actions.PerWindowKeys

Contents

Description

Define key-bindings on a per-window basis.

Synopsis

Usage

You can use this module with the following in your ~/.xmonad/xmonad.hs:

 import XMonad.Actions.PerWindowKeys
  ,((0, xK_F2), bindFirst [(className =? "firefox", spawn "dmenu"), (isFloat, withFocused $ windows . W.sink)])
  ,((0, xK_F3), bindAll [(isDialog, kill), (pure True, doSomething)])

If you want an action that will always run, but also want to do something for other queries, you can use bindAll [(query1, action1), ..., (pure True, alwaysDoThisAction)].

Similarly, if you want a default action to be run if all the others failed, you can use bindFirst [(query1, action1), ..., (pure True, doThisIfTheOthersFail)].

For detailed instructions on editing your key bindings, see XMonad.Doc.Extending.

bindAll :: [(Query Bool, X ())] -> X () Source #

Run an action if a Query holds true. Doesn't stop at the first one that does, however, and could potentially run all actions.

bindFirst :: [(Query Bool, X ())] -> X () Source #

Run the action paired with the first Query that holds true.