2zw
Owner: IIIlllIIIllI URL: git@git.0x00nyx.xyz:seb/2zw.git
README
2zw
===
2zw is a fast, lean window manager for X written in Zig.
It follows loosely the 2wm design from suckless.org.
The codebase now targets portable POSIX APIs so it builds cleanly on both Linux and OpenBSD.
Features
--------
- Small hackable codebase
- Master/stack tiling
- Attach/detach instead of workspaces
- No configuration file parsing, configured via source
- Floating window support
- Focus border colouring
- Bar (bat, date/time)
- Gaps
Requirements
------------
In order to build 2zw you need:
- Zig compiler (0.13.0 or newer, tested with 0.14.0)
- Xlib header files
- libX11-dev
- libXrandr-dev
- On OpenBSD these live under `/usr/X11R6`; the build script adds the paths automatically.
Installation
------------
Edit `build.zig` to match your local setup if you want a different prefix
(2zw installs into `/usr/local` namespace by default). No manual edits are required
for OpenBSD include/library search paths.
Afterwards enter the following command to build and install 2zw:
zig build install
Running 2zw
-----------
Add the following line to your .xinitrc to start 2zw using startx:
exec 2zw
In order to connect 2zw to a specific display, make sure that
the DISPLAY environment variable is set correctly, e.g.:
DISPLAY=foo.bar:1 exec 2zw
Configuration
-------------
Everything lives in `src/main.zig`; edit constants and rebuild.
Defaults worth noting:
- `FOCUS_BORDER_COLOR = 0xffd787`
- `NORMAL_BORDER_COLOR = 0x333333`
- `BORDER_WIDTH = 2`
- `terminal = "st"`
- `launcher = "dmenu_run"`
Key bindings (Mod4): q kill, a attach, d detach, , prev, . next, Return terminal, p launcher, s slock.
Commits
| Hash | Date | Author | Subject |
| c655871 | 2025-12-20 12:17:44 +0100 | IIIlllIIIllI | license |
| ab24deb | 2025-12-20 12:02:13 +0100 | IIIlllIIIllI | init commit, new repo |