Contributing
Getting the source
git clone https://github.com/tonybanters/oxwm
cd oxwm
zig buildYou need Zig 0.16.0 or newer and the libraries listed under Installation. With Nix, nix develop gives you a shell with everything in it.
Testing
Do not test a window manager in the session you are working in. oxwm has build steps that start a nested X server on display :2 and run oxwm inside it:
| Command | What it does |
|---|---|
zig build xephyr |
Run in Xephyr at 1280x800 |
zig build xephyr-multi |
Run in Xephyr with a multi-monitor setup |
zig build xwayland |
Run in Xwayland |
zig build kill |
Stop Xephyr and oxwm |
zig build test |
Run the unit tests |
zig build fmt |
Format the source |
Layout of the repo
| Path | Contents |
|---|---|
src/main.zig |
Entry point and command line flags |
src/wm/ |
Event loop, event handlers and actions |
src/layouts/ |
One file per layout |
src/bar/ |
The status bar, its blocks and the systray |
src/config/lua.zig |
The Lua API |
src/config/config.zig |
Config struct and defaults |
templates/config.lua |
The default config written by oxwm --init |
templates/oxwm.lua |
Type definitions for the Lua language server |
resources/oxwm.1 |
The man page |
Adding a config option
A new Lua function touches four places:
- Add the field and its default to
Configinsrc/config/config.zig. - Register the function in
src/config/lua.zig. - Describe it in
templates/oxwm.luaso editors know about it. - Show it in
templates/config.lua.
Then add it to these docs. Each page here is one Markdown file.
Sending a pull request
- Fork the repo on GitHub and clone your fork.
- Create a branch:
git checkout -b my-feature. - Make the change and run
zig build fmtandzig build test. - Try it with
zig build xephyr. - Commit, push the branch to your fork and open a pull request.
Do not commit your own ~/.config/oxwm/config.lua. Only change templates/config.lua when you add an option.
Getting help
Bugs and feature requests go on the issue tracker. For questions, the Discord is the fastest way to reach people.