🛠️ Patching & Building dwl
Vanilla dwl does not support Waybar or overlay layers natively. To get Waybar to display tags (workspaces), the active layout, and the window title, you must patch dwl before compiling it.
Required Protocols/Patches
You need to add three protocol XML files to your dwl source directory (specifically inside a protocols/ folder) and ensure the Makefile generates the headers for them:
- dwl-ipc-unstable-v2.xml: This is the most critical patch. It creates an IPC (Inter-Process Communication) interface so
dwlcan broadcast its state (active tags, layout, focused window) to external bars like Waybar. - wlr-layer-shell-unstable-v1.xml: Allows programs (like Waybar or Rofi) to create overlay layers on top of normal windows. Without this, your bar might hide behind applications.
- wlr-output-power-management-unstable-v1.xml: Used for idle management and screen DPMS (turning off the screen after inactivity).
Applying the Patches
-
Clone the dwl source:
git clone https://codeberg.org/dwl/dwl.git cd dwl -
Create the protocols directory and move the XML files:
mkdir protocols # Copy the 3 .xml files into this directory -
Edit the
Makefile: You must instruct the build system to compile these protocols into C headers and source files. Add the protocol generation rules to yourMakefilesomakeknows how to turn the XML files into.hand.cfiles thatdwl.ccan understand. -
Edit
dwl.c: You must#includethe generated protocol headers at the top ofdwl.c, set up the global variables for the IPC manager, and hook the broadcast functions into dwl's main event loop (output layout change, focus change, etc.).
Note: The exact lines to add to Makefile and dwl.c can be complex. It is highly recommended to refer to the patched files provided in this repository's dwl/dwl/ directory as a reference for where these hooks go.
Building against wlroots 0.20 (September 2026)
Vanilla dwl still targets wlroots 0.19 and upstream is unmaintained, so this repository carries a small port to wlroots 0.20 on top of the protocol patches above. If you build from this repo, nothing extra is needed — config.mk already points at wlroots-0.20. If you patch a fresh vanilla checkout yourself, apply these three changes:
-
Point the build at 0.20 — in
config.mk, replacewlroots-0.19withwlroots-0.20:sed -i 's/wlroots-0\.19/wlroots-0.20/g' config.mk -
xdg-shell version macros — dwl checks
XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSIONandXDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION. If your generatedxdg-shell-protocol.hdoes not define them, add this to the top ofdwl.candclient.h:#ifndef XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION #define XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION 5 #endif #ifndef XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION #define XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION 6 #endif -
Xwayland cursor API change —
wlr_xwayland_set_cursor()now takes astruct wlr_buffer *instead of a raw pixel array. This config disables that call (commented out inxwaylandready()); Xwayland falls back to its default cursor, which is harmless for a tiling setup.