oxwm github discord tonybtw.com

Contributing

Getting the source

git clone https://github.com/tonybanters/oxwm
cd oxwm
zig build

You 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:

  1. Add the field and its default to Config in src/config/config.zig.
  2. Register the function in src/config/lua.zig.
  3. Describe it in templates/oxwm.lua so editors know about it.
  4. Show it in templates/config.lua.

Then add it to these docs. Each page here is one Markdown file.

Sending a pull request

  1. Fork the repo on GitHub and clone your fork.
  2. Create a branch: git checkout -b my-feature.
  3. Make the change and run zig build fmt and zig build test.
  4. Try it with zig build xephyr.
  5. 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.