A small, hackable tiling window manager for X11. Wayland is not supported currently.
Status: Actively being revived as of October 2025. This repository has been refreshed to use a modern Cabal (v2) workflow with reproducible builds and a clean developer experience. Expect rough edges while we modernize CI and packaging. Feedback and PRs welcome.
- Requirements
- Installation
- System packages (X11 headers/libs)
- Build
- Configuration
- Run
- Development notes
- Contributing
- Recommendations
- License
- A supported X11 environment (Xorg or Xwayland/Xephyr for testing).
- GHC and cabal-install (GHCup recommended)
- X11 development headers (listed below per distro).
Recommended toolchain (for development):
- GHC 9.6.7 (or current GHCup recommended)
cabal-install3.12+ (or GHCup recommended)- Optionally Haskell Language Server (HLS) for editor integration
The project uses a
cabal.projectwith a pinnedindex-statefor reproducible dependency resolution.
# 1) Install the Haskell toolchain (ghc, cabal)
# recommended ultra-easy route: [GHCup](https://www.haskell.org/ghcup/)
# 2) Ensure you have the current recommended versions of ghc/cabal
ghcup install ghc recommended && ghcup set ghc recommended
ghcup install cabal recommended && ghcup set cabal recommended
# 3) Clone
git clone https://github.com/zmeadows/sunwm.git
cd sunwm
# 4) Install system packages (see section below for your distro)
# e.g., on Ubuntu:
sudo apt update && sudo apt install -y build-essential pkg-config \
libx11-dev libxrandr-dev libxinerama-dev libxext-dev
# 5) Build
cabal update
cabal build all
cabal install exe:sunwm \
--project-file=cabal.project.release \
--installdir="$HOME/.local/bin" \ # <- choose install location in your path
--overwrite-policy=always \
--install-method=copyInstall your distribution’s C/C++ toolchain, pkg-config, and X11 client libraries/headers. Package names vary slightly by distro.
sudo apt update
sudo apt install -y build-essential pkg-config \
libx11-dev libxrandr-dev libxinerama-dev libxext-dev# Toolchain group
sudo dnf groupinstall -y "Development Tools"
# X11 headers
sudo dnf install -y libX11-devel libXrandr-devel libXinerama-devel libXext-develsudo pacman -Syu --needed base-devel pkgconf libx11 libxrandr libxinerama libxext# Toolchain
sudo zypper install -y gcc make pkg-config
# X11 headers
sudo zypper install -y libX11-devel libXrandr-devel libXinerama-devel libXext-develsudo apk add --no-cache build-base pkgconfig \
libx11-dev libxrandr-dev libxinerama-dev libxext-dev# Ad-hoc shell with all deps
nix-shell -p ghc cabal-install pkg-config xorg.libX11 xorg.libXrandr xorg.libXinerama xorg.libXextIf you use another distro, search your package manager for the X11 equivalents of the above libs.
# Update indices (pinned by cabal.project)
cabal update
# Build everything (library/executables/tests)
cabal build all
# Run tests (if any test suites are present)
cabal test
# Optional: record the exact dependency plan (commit the file if you want)
cabal freezeIf you hit linking issues, double-check that the X11 -dev/-devel packages are installed and visible to pkg-config.
see Configuration documentation.
Warning: Window managers take over your X session. Start in a nested X server first to keep your desktop safe.
Install Xephyr (package name may be xserver-xephyr on Debian/Ubuntu). Then:
# Terminal 1: start nested X on display :1
Xephyr -br -ac -noreset -screen 1280x800 :1 &
# Terminal 2: run sunwm inside it
DISPLAY=:1 cabal run sunwmIf the executable name differs (e.g. multiple executables), adjust cabal run <exe-name> accordingly.
Create/modify ~/.xinitrc to exec sunwm:
exec sunwmThen from a TTY (e.g. Ctrl+Alt+F3):
startxIf your display manager supports custom sessions, create a .desktop entry pointing to sunwm. Steps differ by DM; consult your DM’s docs.
see Contributing documentation.
- Ratpoison (http://ratpoison.nongnu.org/)
- StumpWM (http://www.nongnu.org/stumpwm/)
- XMonad (http://xmonad.org/)
- i3 (http://i3wm.org/)
- dwm (http://dwm.suckless.org/)
- xmobar (http://projects.haskell.org/xmobar/)
- dmenu (http://tools.suckless.org/dmenu/)
See LICENSE in this repository.