Tomas Janousek 383ffb772e Prevent grabKey from accidentally grabbing all unbound keys
grabKeys doesn't check that a KeySym is valid before looking up the
KeyCode(s) it's bound to. In particular, KeySym 0 (NoSymbol) gets mapped to every
unbound KeyCode, since that's what XKeycodeToKeysym returns for those.

This can most easily be reproduced using `statusBar` in xmonad-contrib,
with def as the key-mapping function; this unexpectedly invokes the
following instances:

    instance Default b => a -> b where def = const def
    instance (Default a, Default b) => (a, b) where def = (def, def)
    instance Default CInt where def = 0

thus producing a function which binds `toggleStruts` to the (KeyMask,
KeySym) pair (0, 0) (and demonstrating why Default is a dangerous
abstraction). The person who reported this used xmodmap to clear KeySyms
from their numpad keys, and then xmonad would bind strut toggling to the
entire numpad.

Note that it is not reliably possible to override `def` in this
situation (without introducing a new type); the only thing we can do is
try to avoid the aftermath, and I would expect that an inadvertent 0
KeySym is the most common error here anyway.

Fixes: https://github.com/xmonad/xmonad/issues/293
Fixes: 40cb12ce17 ("Grab all keycodes linked to each keysym, not just one")
Co-authored-by: Brandon S Allbery KF8NH <allbery.b@gmail.com>
2021-05-21 11:41:52 +01:00
2021-04-27 11:05:32 +01:00
2021-03-31 12:00:30 +01:00
2021-01-07 17:25:30 +01:00
2008-01-08 18:56:40 +00:00
2020-12-11 18:10:35 +05:30
2007-03-07 01:35:27 +00:00
2015-11-28 16:23:24 -05:00

xmonad: A Tiling Window Manager

Stack Tests

xmonad is a tiling window manager for X. Windows are arranged automatically to tile the screen without gaps or overlap, maximising screen use. Window manager features are accessible from the keyboard: a mouse is optional. xmonad is written, configured and extensible in Haskell. Custom layout algorithms, key bindings and other extensions may be written by the user in config files. Layouts are applied dynamically, and different layouts may be used on each workspace. Xinerama is fully supported, allowing windows to be tiled on several physical screens.

Quick Start

For the full story, read on.

Building

Building is quite straightforward, and requires a basic Haskell toolchain. On many systems xmonad is available as a binary package in your package system (e.g. on Debian or Gentoo). If at all possible, use this in preference to a source build, as the dependency resolution will be simpler.

We'll now walk through the complete list of toolchain dependencies.

  • GHC: the Glasgow Haskell Compiler

    You first need a Haskell compiler. Your distribution's package system will have binaries of GHC (the Glasgow Haskell Compiler), the compiler we use, so install that first. If your operating system's package system doesn't provide a binary version of GHC and the cabal-install tool, you can install both using the Haskell Platform.

    It shouldn't be necessary to compile GHC from source -- every common system has a pre-build binary version. However, if you want to build from source, the following links will be helpful:

  • X11 libraries:

    Since you're building an X application, you'll need the C X11 library headers. On many platforms, these come pre-installed. For others, such as Debian, you can get them from your package manager:

    # for xmonad
    $ apt-get install libx11-dev libxinerama-dev libxext-dev libxrandr-dev libxss-dev
    
    # for xmonad-contrib
    $ apt-get install libxft-dev
    

Then build and install with:

$ cabal install

Running xmonad

If you built XMonad using cabal then add:

exec $HOME/.cabal/bin/xmonad

to the last line of your .xsession or .xinitrc file.

Configuring

See the CONFIG document and the example configuration file.

XMonadContrib

There are many extensions to xmonad available in the XMonadContrib (xmc) library. Examples include an ion3-like tabbed layout, a prompt/program launcher, and various other useful modules. XMonadContrib is available at:

Other Useful Programs

A nicer xterm replacement, that supports resizing better:

For custom status bars:

For a program dispatch menu:

Authors

  • Spencer Janssen
  • Don Stewart
  • Jason Creighton
Description
The core of xmonad, a small but functional ICCCM-compliant tiling window manager
Readme BSD-3-Clause 6.3 MiB
Languages
Haskell 97.6%
Nix 2%
Shell 0.4%