This is slowly turning my xmonad setup into a homebrew desktop environment. Most features are implemented directly by the xmonad instance while some of the more sophisticated stuff is in external libraries.
The xmonad.hs
file contains only updates to the default config and tons of keybindings. Most of the interesting stuff is implemented as separate modules under the MyXMonad
directory.
Because this project is getting increasingly complex with tons of dependencies which pollute the global space I have converted the entire project to a stack project. I include the packages xmonad
, xmonad-contrib
and mpris
locally as I hack on them quite often. The definition for the xmonad
executable is inside my-xmonad.cabal
.
For the first time you have to manually “bootstrap” xmonad by using stack install
from inside the ~/.xmonad
directory. Since version 0.13
xmonad supports custom rebuild script which is located in build
file inside ~/.xmonad
. For me this just rebuilds the program with stack:
#!/bin/sh
cd ~/.xmonad
stack --stack-yaml stack.yaml ghc -- --make xmonad.hs -i -fforce-recomp -main-is main -v0 -o $1
Brightness.hs
has some code to set brightness levels.Constants.hs
contains constants and settings, such as managehooks, printers, prompts and so on.IdoFile.hs
is a prompt mirroringido-find-file
behaviour from emacsInteractive.hs
is a library providing Emacs-like interactive promptsMPD.hs
is an interface tompd
. It has some custom prompts and lifts some ofNetwork.MPD
actions intoX
monad. Might interest you if you usempd
.Mount.hs
is some magic for semi-automatic mounting of volumes. Very experimental.Mpris.hs
is an interface to mpris2 protocol, powered by my other library: mpris. It has some interop withMPD.hs
to allow for seamless switching.PulseAudio.hs
controls pulseaudio volume levels.StackSetExtra.hs
contains some extra operations on window sets or helpers to execute stuff on other screens in multiscreen setup.Utils.hs
is just regular pure functions used to make some things a bit more convenientWorkspaces.hs
contains utils to work with workspaces. Currently only some facilities to make binding of keys less annoying (you can bind an action to a set of workspaces at once, such as “view the workspacen
”).
Also included is xmobar
config, see the file xmobarrc
.
- Add some code to detect changes in attached displays and automatically reconfigure (I now have a small C utility called xmonitor for this, maybe I will integrate it with xmonad/haskell one day).
Before the project was converted I kept the configuration in my dotfiles repository.