xmonad configuration examples
For more screenshots see the Xmonad/Screenshots archive.
EwmhDesktops users upgrading to xmonad-0.9 , please note layoutHook, handleEventHook, startupHook change. For more information about how to update your Ewmh configuration, and other changes that may require edits to
xmonad.hs, see the 0.9 release changelog.
Template xmonad config files
The template xmonad.hs file shows all the default xmonad settings; it is merely a slightly modified reference copy of the XMonad source module which sets up the configuration. Note that while this file is usable, it contains lots of uneeded extra settings; normally you would only include and customize the parts you want to change. If you don't want to use the minimal style as shown in the following tutorial, you can instead copy-and-paste from the template instead.
man/xmonad.hs file distributed with xmonad source, or you can
download the latest darcs template xmonad.hs from
Minimal xmonad config files
See the John Goerzen tutorial for an example of customizing a minimal xmonad.hs like the following:
Current release and darcs (development) version config files
- /31d1's xmonad.hs (darcs/gnome)
- /adamvo's xmonad.hs (darcs)
- /jelly(12gen)'s xmonad.hs (0.9)
- /jelly(12gen)'s xmobarrc
- Standard setup using ShellPrompt, Actions.Search, xmobar, urgencyhook, custsom keybindings.
- /Andrea Rossato's xmonad.hs (0.8)
- Tabbed, Xmobar with DynamicLog, (Shell|Ssh|Man)Prompt.
- /Andrea Spada xmonad.hs (0.8)
- Tall, Resizable Mosaic and Combo, EvmhDesktops, additional keybindings - Work In Progress...
- /andrewsw's xmonad.hs (0.8)
- /andrewsw's .Xdefault
- /And1's xmonad.hs (darcs)
- mirrored layout, manageHook, dynamicLog with dzen, conky piped into dzen,
- urgency hints, perWorkspace layouts, gimpLayout, PP for dzen and xmobar,
- custom keys with application shortcuts and mpd controls, gridSelect;
- more of my screenshots can be found in my screenshots/ directory
- /brad's xmonad.hs (0.8)
- very basic, just some cosmetic and key-shortcut changes
- /Brent Yorgey's darcs xmonad.hs (darcs)
- modMask = mod4Mask; DynamicLog, RotView, ViewPrev, WindowNavigation, ToggleLayouts (toggle full screen mode), UrgencyHook + dzen, FlexibleManipulate, a bunch of Prompts, Submap, Search, and a few others, with keybindings for all! (Warning: lots of non-standard keybindings. =)
- /David Roundy's xmonad.hs (0.8)
- /doitan's xmonad.hs (0.8)
- /Don's xmonad.hs (0.9)
- colours, use custom terminal, dynamicLogDzen
- /enko's xmonad.hs (0.8)
- /gray_hemp's xmonad.hs (0.9)
- /gray_hemp's .conky_time
- dzen + conky config using dzen layout icons, resizable tall, xmonad shell prompt, urgency popup plus status bar formatting.
- /Gwern's xmonad.hs (darcs)
- Ratpoison-y keybindings; example usage of XSelection.
- /John Goerzen's Configuration and Tutorial (0.8)
- /John Yates' polished Gnome bar (0.8)
- /Josh Rickmar's xmonad.hs (0.8)
- /Josh Rickmar's dzenscript
- /lars' xmonad.hs (0.8)
- Move/Resize windows using keyboard easily:
- 1. move window around using M-Arrows.
- 2. resize windows using C-Arrows.
- 3. Holding <Shift> to move/resize 2 pixels per step instead of 20 pixels.
- Please find the lines below comment "-- moving floating window with key" to see details.
- /lithis's xmonad.hs (darcs)
- /lithis's xmobarrc (newer than xmobar-0.9)
- /loupgaroublonds xmonad.hs (darcs)
- a somewhat modified config but with support for gnome and my cat
- /Marcot's xmonad.hs (darcs)
- With Gnome support and Multimedia Keyboard configuration
- /Mntnoe's xmonad.hs (0.8 modified)
- Modular xmonad config. Labeled pager addon for DynamicLog. Fast navigation between workspaces. Application specific border colors. Modified Scratchpad using GNU Screen. Host specific settings.
- /nattfodd's xmonad.hs (0.8/darcs)
- /Octoploid's xmonad.hs (0.9)
- Xmobar with customized DynamicLog, CycleWS with custom keys, colors, terminal, golden ratio
- /oxymor00n's xmonad.hs (darcs)
- /oxymor00n's xmobarrc
- /Robert Manea's xmonad.hs (0.8)
- /rtalreja's xmonad.hs (0.8.1)
- /rtalreja's .conkyrcdzen
- /sereven-xmonad.hs (0.9)
- FadeInactive excluding some windows. Additional left hand key bindings for screens, workspaces, scratchpad, etc -- plus misc xmonad and haskell searches. Also spawnOnce via
pidofand gimp layout for people that combine gimp toolboxes (use single dock for panels).
- /skorpan's xmonad.hs (0.8)
- /skorpan's xmobarrc (0.9)
- /sykopomp's xmonad.hs (darcs)
- /sykopomp's xmonad.dv-vi.hs
- /TeXitoi's xmonad.hs (0.7 and 0.8)
- French keyboard, ManageDock, EwmhDesktops. Minimal configuration file with Defaults not overwritten. Mist GTK theme is used.
- /Thomas ten Cate's xmonad.hs (0.8)
- Extensive comments at the top of the file explain the keybindings and usage.
- /thoughtpolice's xmonad.hs (darcs)
- /thoughtpolice's xmobarrc (0.9)
- /twifkak's xmonad.hs (0.8)
- /void's xmonad.hs (0.8)
- /vvv's xmonad.hs (0.8)
- /webframp's xmonad.hs (darcs)
- Basic Mirror tiled and ResizableTall layout, EZConfig keybindings,
- /Wraithan's xmonad.hs (darcs)
- /lazor's xmonad.hs (0.8)
- working xmonad.hs for KDE 4.2
This section is for configurations which do not work with the development XMonad and XMonadContrib, or at least the latest release.
Note that the configuration file is 'Config.hs' for xmonad < 0.5, but 'xmonad.hs' for xmonad >= 0.5.
- /Template xmonad.hs (0.8)
- /Template xmonad.hs (0.7)
- /Template xmonad.hs (0.6)
- Previous versions of the default configuration.
- /andrewsw's xmonad.hs (0.6)
- /arossato's Config.hs (0.4)
- /cce xmonad.hs (0.5)
- alt+enter full screen, alt+hjkl to navigate, many remapped keys
- /deifl's xmonad.hs (0.5)
- /Don's Config.hs (0.4)
- /entropies xmonad.hs (0.5)
- windows as meta key, fullscreen & noborders on keypress for client. custom keybindings. magnifier.
- /Eric Mertens' xmonad.hs (0.5)
- /Eric Mertens's Config.hs (0.4)
- /Erthad's xmonad.hs (darcs 25 Aug 2008/0.7)
- mixed hotkeys config (standard+EZConfig), wmii-like keyboard behavior,
- EWMH desktops, dzen integration (dzen configs see at http://fly.osdn.org.ua/~erthad/)
- /Gwern's Config.hs (0.4) (old)
- /Lee Aylward's xmonad.hs (0.5)
- Resizable Tall, NoBorders, dzen DynamicLog, rhythmbox control shortcuts, windows key
- /Mr.Elendig's xmonad.hs (0.7)
- Somewhat simple, but verbose config, with ResizableTall, xmobar and mpd controlls.
- /nomeatas Config.hs (0.4)
- modMaks = mod4Mask; gnome-stuff
- /nomeata’s xmonad.hs (xmonad 0.7)
- /OldSchoolWSNav xmonad.hs (0.8)
- FWIW example config to experiment with gnome-like workspace navigation, where all physical screens shift at once and use one workspace. Beware: uses two modules without maintainers, LayoutScreens and LayoutCombinators. LayoutCombinators puts windows into combined layouts one after the other, so with one layout tabbed, the other will always be full. Using Grid or other layouts might be better than using LayoutCombinators. Uses dzen2 to display workspaces and layout names.
- /Ray's xmonad.hs (0.5)
- /Remi's xmonad.hs (0.7)
- /Remi's .xmobarrc (0.8)
- /Remi's .xinitrc
- /sereven's xmonad.hs (0.7) cross-host
- /sereven's xmonad.hs one-host (0.8)
- Colors, homedir, mod key modified per host, dzen scaled to different screen sizes, so can use one
xmonad.hs. 'h,j,k,l' directional navigation with resizableTall and toggle noBorders Full for borderless xinerama screen, perWorkspace IM layout for tiled gimp, dzen format stripper for independent ppUrgent and ppHidden formatting. File:--Xmonad16.xpm-- icon from dzen config.
- /sphynx's xmonad.hs (0.7)
- /twifkak's Config.hs (0.4)
- /Wfarr's xmonad.hs (0.6)
- /Xilon's xmonad.hs (0.5)
/iderrick xmonad.hs (0.8)
Note on uploading
Request a haskell wiki account if needed.
To upload your config file, create some text on this page of the form:
; [[/you xmonad.hs]](0.9) : description of your setup
which will scale the image correctly for a thumbnail.
import Path.To.Foo, the download script below limits the usability of your uploaded config. Till it's made smarter, if you want your modular config to be easily downloadable, convert it into a single chunk of valid haskell between the first pair of <haskell> and </haskell> tags (each tag on its own line) i.e. comment the "module Foo where"s and their imports, merging them into a single import list, (qualifying as necessary).
A converter script might be useful as well.
Downloading all configs
import Text.HTML.Download (openURL) import Text.HTML.TagSoup (parseTags, Tag(TagOpen)) import Data.List (isInfixOf, isPrefixOf) import Control.Monad (liftM,liftM2, zipWithM_) main :: IO () main = do urls <- liftM extractURLs $ openURL "http://haskell.org/haskellwiki/Xmonad/Config_archive" -- urls are prefixed "/haskellwiki/", so in raws, drop 13: let raws = map (\x -> "http://haskell.org/haskellwiki/?title=" ++ drop 13 x ++ "&action=raw") $ filter (isInfixOf "xmonad.hs") urls let hs = map (liftM2 fmap filterHaskell openURL) raws zipWithM_ (\x y -> writeFile x =<< y) (map ((++ ".hs") . show) [(1::Int)..]) hs filterHaskell :: String -> String -> String filterHaskell url = addLink . unlines . takeWhile (not . isPrefixOf "<nowiki>
extractURLs :: String -> [String] extractURLs arg = [x | TagOpen "a" atts <- (parseTags arg), (_,x) <- atts, "/haskellwiki/Xmonad/Config_archive/" `isPrefixOf` x]
% runhaskell get-xmconfigs
Module Import Popularity
Here is a script to summarize the imports in a given directory of .hs files, such as the ones downloaded by the script in the previous section.
#!/usr/bin/runghc import System.Directory(getDirectoryContents) import System.FilePath(splitExtension) import Control.Applicative((<$>)) import Control.Monad(mapM) import Data.Char(isNumber, isSpace) import Data.List(foldl', sortBy, stripPrefix) import Data.Maybe(mapMaybe) import Data.Monoid(mconcat) import Data.Ord(comparing) import qualified Data.Map as M main = do fs <- filter ((\(fn,ext) -> ext == ".hs" && all isNumber fn) . splitExtension) <$> getDirectoryContents "." let getModName :: String -> [String] getModName = map (takeWhile (\x -> not $ isSpace x || x == '(')) . mapMaybe (mconcat $ map stripPrefix ["import qualified ","import "]) . lines xs <- mapM (fmap getModName . readFile) fs putStr . unlines . map show . sortBy (comparing snd) . M.toList . foldl' (\m k -> M.insertWith (+) k 1 m) M.empty . concat $ xs
Part of the output showing the most popular modules in the config archive is: