NanoWM is an ultra-minimalist, macro-driven tiling window manager for X11. Written in C, it is designed to be as small and fast as possible by utilizing the Tiny C Compiler (tcc) and a "header-less" design philosophy.
It implements a "monocle-style" tiling approach where every window is automatically resized to fill the current monitor's dimensions.
- Automatic Fullscreen Tiling: No manual resizing needed; windows automatically adapt to the screen/monitor dimensions.
- Xinerama Multi-Monitor Support: Seamlessly jump focus between screens and move windows across monitors.
- Macro-Powered Config: Centralized keybinding table for easy customization.
- Ultra-Lightweight: Compiled with
tccfor a tiny binary and near-instant execution. - Pointer Warping: Automatically centers the mouse when switching monitors to maintain a "focus-follows-mouse" workflow.
The Mod Key is Alt (Mod1). Hardware/Special controls use the Super (Mod4) or Shift combinations.
| Key Combo | Action |
|---|---|
Alt + ; |
Launch Terminal (st) |
Alt + u |
Cycle focus/windows up |
Alt + ' |
Kill current window |
Alt + i |
Focus next monitor (Warp pointer) |
Alt + o |
Send current window to next monitor |
Alt + Esc |
Exit NanoWM |
| Key Combo | Action |
|---|---|
Alt + d |
Rofi (Command Run) |
Alt + m |
Rofi (All Scripts) |
Alt + p |
Power Menu |
Alt + k |
Keybindings Help Script |
Alt + f |
File Manager (nnn in st) |
Alt + e |
File Manager (Thunar) |
Alt + b |
Browser (Chromium) |
Alt + Shift + b |
Browser (Librewolf) |
Alt + Shift + t |
Date/Time Script |
| Key Combo | Action |
|---|---|
Super + [ |
Decrease Brightness |
Super + ] |
Increase Brightness |
Alt + [ |
Redshift: Night Mode (3500K) |
Alt + ] |
Redshift: Reset |
Alt + , |
WiFi On |
Alt + . |
WiFi Off |
You need the X11 and Xinerama development headers, plus the Tiny C Compiler.
- NixOS (Imperative): ```bash nix-env -iA nixos.tinycc nixos.libX11 nixos.libXinerama
- NixOS (Declarative): Add
tinycc,libX11, andlibXineramato yourenvironment.systemPackages. - Arch Linux:
sudo pacman -S libx11 libxinerama tcc - Debian/Ubuntu:
sudo apt install libx11-dev libxinerama-dev tcc
The install.sh script compiles the source and moves the binary to /usr/local/bin/.
git clone https://github.com/wmouton/nanowm.git
cd nanowm
chmod +x install.sh
./install.sh
NanoWM is configured by editing nanowm.c directly:
- Main Bindings: Edit the
TBL(x)macro to change keys and shell commands. - Special Grabs: Modify the
XGrabKeycalls inmain()for combinations involvingShiftorSuper. - Wallpaper: Update the
system("feh ...")path inmain(). - Recompile: Simply run
./install.shagain to apply changes.
Add the following to your .xinitrc:
exec nanowm
The default configuration relies on:
st,nnn,thunar,chromium,librewolfrofi,brightnessctl,nmcli,redshift,feh- Custom scripts located in
~/dotfiles/
{
description = "NanoWM - A minimalist, ultra-lightweight tiling window manager";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = system: import nixpkgs { inherit system; };
in
{
packages = forAllSystems (system:
let
pkgs = nixpkgsFor system;
in
{
default = pkgs.stdenv.mkDerivation {
pname = "nanowm";
version = "0.1.0";
src = ./.;
# Runtime dependencies (libraries)
buildInputs = with pkgs; [
xorg.libX11
xorg.libXinerama
];
# Build tools
nativeBuildInputs = with pkgs; [
tinycc
];
buildPhase = ''
tcc -lX11 -lXinerama nanowm.c -o nanowm
'';
installPhase = ''
mkdir -p $out/bin
cp nanowm $out/bin/
'';
meta = with pkgs.lib; {
description = "A minimalist tiling window manager for X11";
license = licenses.mit;
platforms = platforms.linux;
};
};
});
# Development shell for 'nix develop'
devShells = forAllSystems (system:
let pkgs = nixpkgsFor system;
in {
default = pkgs.mkShell {
buildInputs = with pkgs; [
tinycc
xorg.libX11
xorg.libXinerama
xorg.xinit
];
};
});
};
}