unixchad/kwm
4
14
Fork
You've already forked kwm
0
A window manager based on River Wayland compositor
  • Zig 100%
Find a file
2026年06月11日 17:01:56 +08:00
.github/ISSUE_TEMPLATE github: remove render property from logs 2026年05月13日 09:28:59 +08:00
contrib build: install icons 2026年04月23日 22:07:09 +08:00
doc doc: update for centered master layout 2026年05月16日 15:20:37 +08:00
images update README.md 2026年01月19日 13:56:56 +08:00
logo build: install icons 2026年04月23日 22:07:09 +08:00
misc Mod(README): update repo logo 2026年03月29日 11:30:13 +08:00
patches/bar-less-padding Mod(patches): move bar-solid-box-color to patches-stale 2026年04月16日 15:51:04 +08:00
patches-stale Mod(patches): move bar-solid-box-color to patches-stale 2026年04月16日 15:51:04 +08:00
protocol feat: extract code to kwim 2026年03月30日 21:34:21 +08:00
src Merge branch 'kewuaa-master' 2026年06月11日 17:01:56 +08:00
.gitignore upgrade to zig 0.16 2026年05月17日 10:01:34 +08:00
build.zig upgrade to zig 0.16 2026年05月17日 10:01:34 +08:00
build.zig.zon bump version to v0.3.0 2026年05月18日 19:25:08 +08:00
config.def.zon fix(config.def.zon): window borders overlapping 2026年06月04日 10:37:33 +08:00
LICENSE Add: LICENSE GPL-3.0 2026年01月21日 15:02:33 +08:00
README.md Merge branch 'kewuaa-master' 2026年05月17日 10:22:19 +08:00

kwm

My build of kwm - kewuaa's Window Manager

River is a non-monolithic Wayland compositor, it does not combine the compositor and window manager into one program.

kwm is a DWM-like dynamic tiling window manager implementing the river-window-management-v1 protocol.

Screenshots

tile

grid

monocle

scroller

For changes I've made, check patches

Features

  • Layouts: tile, grid, monocle, deck, scroller, centered master, and floating, with per-tag states

  • Tags: organize windows with tags instead of workspaces, with shift-tags support

  • Rules: regex pattern matching for window rules

  • Modes: separate keybindings for each mode (default, lock, passthrough, custom)

  • Window States: swallow, maximize, fullscreen, fake fullscreen, floating, sticky

  • Autostart: run commands on startup

  • Status Bar: dwm-like bar, supporting static text, stdin, and fifo, with customized colors

  • Configuration: support both compile-time and runtime configuration, reloading on the fly

See the default configuration file for detailed features.

Dependencies

  • wayland (libwayland-client)
  • xkbcommon
  • pixman (if bar enabled)
  • fcft (if bar enabled)
  • wayland-protocols (compile only)

Build

Requires zig 0.16.x.

zig build -Doptimize=ReleaseSafe
  • -Dllvm: force using LLVM compiler and linker
  • -Dconfig: specify the default config file path (defaults to config.zon, copied from config.def.zon if missing)
  • -Dbackground: enable or disable the solid background (defaults to false)
  • -Dbar: enable or disable the status bar (defaults to true)
  • -Dkwim: if to call kwim automatically (defaults to true)

Installation

See packages.md for community maintained packages.

zig build install -Doptimize=ReleaseSafe
  • --prefix: specify the path to install files

Configuration

Compile Time

Make custom modifications in config.zon (if -Dconfig is not specified).

Runtime

kwm searches for a user configuration in the following paths:

  • $XDG_CONFIG_HOME/kwm/config.zon
  • $HOME/.config/kwm/config.zon

The user configuration overrides compile-time configuration. You only need to specify the values you want to change, rather than duplicating the entire configuration.

User configuration can be reloaded on the fly with mod4+shift+r.

Configuration Preprocessing

Before loading the configuration, kwm can pre-process it by evaluating the conditions, which allows per-host configuration.

Syntax:

// @include(file)// @if(condition)// @elif(condition)// @else// @endif

Conditions (separated by ,):

  • hostname=HOSTNAME
  • env:KEY=VALUE
  • env_contains:KEY

Usage

Run kwm in your river init file, or start it with river -c kwm.

See kwm(1) man page for complete documentation.

See Useful Software in river wiki for compatible software.

Keybindings

See keybindings or KEYBINDINGS section in kwm(1) man page for default keybindings.

Keymaps

Keyboard mapping can be customized by setting XKB layout rules before launching river. For example, to swap CapsLock with Escape, and Mod1 with Mod4:

export XKB_DEFAULT_OPTIONS=caps:swapescape,altwin:swap_alt_win

See xkeyboard-config(7) man page for all options.

Input Manager

There is an input device manager for river separated from kwm called kwim, implementing the river-input-management-v1 protocol and/or related protocols in order to configure input devices independent of window manager.

When built with the -Dkwim option (defaults to true), kwm will call kwim at startup. You can also run kwim to list input devices or apply a single rule on demand.

How I run kwm with river

Read status from a fifo(to restart the status command without restarting kwm)

// config.zon.status=.{.fifo="${XDG_RUNTIME_DIR}/damblocks.fifo"},

Add below in ~/.config/river/init

/usr/local/bin/kwm &
# https://codeberg.org/unixchad/damblocks
${HOME}/.local/bin/damblocks --fifo &

And run

exec ssh-agent river

To restart the bar script

nohup damblocks --fifo >/dev/null 2>&1 &

Acknowledgments

Thanks to the following reference projects:

License

The source code of kwm is released under the GPL-3.0.

The protocols in protocol/ directory prefixed with river and developed by the River project are released under the ISC license (as stated in their copyright blocks).

kwm's logo is a recreation based on River's logo and released under the CC-BY-SA-4.0 license.

Contributing

Contributions are welcome! By contributing to kwm, you agree that your submitted code will be licensed under GPL-3.0. It is the contributors' responsibility to ensure that all submitted code is either original or GPL-3.0-compatible.