mkdir -p ~/.config/xmonad
# Create ~/.config/xmonad/xmonad.hs
cd ~/.config/xmonad
git clone https://github.com/xmonad/xmonad
git clone https://github.com/xmonad/xmonad-contrib
stack init
stack install
cat << EOF > ~/.config/xmonad/build
#!/bin/bash
OUTPUT=xmonad-bin-test
if [ -n "$1" ]; then
OUTPUT="$1"
fi
exec stack ghc -- \
--make xmonad.hs \
-i \
-ilib \
-fforce-recomp \
-main-is main \
-v0 \
-o "$OUTPUT"
EOF
chmod +x ~/.config/xmonad/build
~/.config/xmonad/build
export PATH="$HOME/.local/bin:/home/nmaupu/.ghcup/bin:$PATH"
export XMONAD_CACHE_DIR="$HOME/.config/xmonad"
export XMONAD_CONFIG_DIR="$HOME/.config/xmonad"
export XMONAD_DATA_DIR="$HOME/.config/xmonad"
[...]
exec "$HOME"/.config/xmonad/xmonad-x86_64-linux