XMonad
Sources
Section titled “Sources”Shortcuts
Section titled “Shortcuts”Default
Section titled “Default”mod = configured mod key, default is alt, commonly remapped to Super (Windows) key
| Description | Shortcut |
|---|---|
| Open Terminal | mod + Shift + Enter |
| Open DMenu (Command run) | mod + p |
| Close Window | mod + Shift + c |
| Restart Xmonad | mod + q |
| Change Window focus | mod + j/K |
| Change configured layouts | mod + Space |
| Exit Xonmad (logout) | mod + Shift + q |
Installation
Section titled “Installation”On Ubuntu using APT and on Fedora using DNF
# Install:# - Window manager: xmonad# - Will include Haskell and Haskell compiler# - xterm: default terminal# - Module manager: xmonad-contrib (Arch), libghc-xmonad-contrib-dev (Ubuntu)# - DMenu: command runner# - xmobar: status barsudo apt install xmonad libghc-xmonad-contrib-dev xterm dmenu xmobar
# Fedora:sudo dnf install xmonad ghc-xmonad-contrib-devel xterm dmenu xmobar# Fedora workaround to usr/lib/rpm/redhat/redhat-annobin-cc1 no such file error during gccsudo dnf install redhat-rpm-config
# Logout to log into XmonadConfiguration
Section titled “Configuration”- Check example configurations at Xmonad/Config archive - HaskellWiki.
- On errors in the configuration, Xmonad will display errors for you
# Set up base config in Haskell# Download xmonad.hs from Haskell wikimv xmonad.hs ~/.xmonad/xmonad.hscp /usr/share/doc/xmobar/examples/xmobar.config ~/.config/xmobar/xmobarrc- Example changes and add comments:
- Imports
- Terminal, change terminal program
- Mod key (default is alt), you will likely want to change to
mod4Maskto change it to Super (Windows) key - Focused/no focused border
- Key / mouse bindings
- Windows rules
- Floating (non-tiled)
- Tiled
- Startup:
myStartupHook- Programs to always start like wallpaper, transparency, compositor
- Define shell commands to execute
- Example
-
Example xmonad.hs
-- Manage docks like gnome panel, xmobar-- https://hackage.haskell.org/package/xmonad-contrib-0.17.1/docs/XMonad-Hooks-ManageDocks.htmlimport XMonad.Hooks.ManagerDocksimport XMonad.Util.Runimport XMonad.Util.SpawnOncemyTerminal = "gnome-terminal"-- ...myStartupHook = do-- wallpaperspawnOnce "nitrogen --restore &"-- Allow xmobar to display above windwsmyLayout = avoidStruts (tall ||| mirror tall ||| full)-- ...main = do-- Launch xmobar on first monitor (0)xmproc <- spawnPipe "xmobar -x 0 ~/.config/xmobar/xmobar.config"-- Other monitors can have different xmobar configs-- xmproc1 <- spawnPipe "xmobar -x 1 ~/.config/xmobar/xmobar1.config"-- xmproc2 <- spawnPipe "xmobar -x 2 ~/.config/xmobar/xmobar2.config"xmonad $ docks def -
Example xmobar.config
killall xmobarand restart xmonad after changes to xmobar configConfit { font = "xft:Ubuntu Mono:pixelsize=16:antialias=true:hinting=true"...