No description
Find a file
Ben Buhse f16f07fa26
Fix zombie processes from keybind spawns
Previously, beansprout used std.process.Child.spawn without ever calling
wait(), leaving exited children as zombies. This commit switches to a
double-fork based off river-classic's spawn handling, where the actual
spawned process gets orphaned and reparented to PID 1. This way, the
parent (i.e. beansprout) only has to wait for the intermediate child.

Also switch tokenizeShell and expandTilde to produce [:0]const u8 tokens
so the argv array for execvpeZ can be built without copying each string.

Fixes: #12
2026-04-26 11:22:35 -05:00
.forgejo/issue_template Add bug issue template (copied from River) 2026-04-11 10:53:07 -05:00
docs Fix crash when changing focused output 2026-04-01 20:32:34 -05:00
examples Implement variable single-window ratio 2026-03-19 15:15:28 -05:00
LICENSES Add REUSE licensing for non-code files 2026-02-11 14:50:04 -06:00
man Add config option for primary_output_follows_pointer + document it 2026-03-29 15:11:02 -05:00
protocol Implement river-xkb-config-v1 2026-03-16 14:19:59 -05:00
src Fix zombie processes from keybind spawns 2026-04-26 11:22:35 -05:00
.gitignore initial commit 2025-05-03 21:07:26 -05:00
build.zig Add git commmit hash to -dev version numbers 2026-04-10 11:33:14 -05:00
build.zig.zon (Re[re])bump version to 0.3.0-dev 2026-04-12 11:31:07 -05:00
README.md Convert single-window.png to jpeg 2026-03-27 10:16:41 -05:00
REUSE.toml Add man pages 2026-02-25 16:02:58 -06:00

beansprout

Single window with gaps Tiled windows

Overview

A tiling window manager for the river Wayland compositor written in Zig. The window manager communicates using the river-window-management-v1 protocol, as well as some of River's additional Wayland protocols.

Beansprout uses a primary/stack tiling layout inspired by dwm with a customizable ratio and primary count. Similarly, beansprout has a 32-bit tag system, rather than workspaces. Each output has its own tags and own primary count/ratio.

Building

Requires Zig 0.15.1 or later.

Dependencies

To compile beansprout, you'll need the dependencies found below. I've listed the package names for Gentoo and Debian/Ubuntu, but they likely exist on all major distros.

Needed at both build-time and runtime:

Dependency Gentoo Name Debian/Ubuntu Name
wayland-client dev-libs/wayland libwayland-dev
pixman x11-libs/pixman libpixman-1-dev
xkbcommon x11-libs/libxkbcommon libxkbcommon-dev
fcft media-libs/fcft libfcft-dev

Only needed at build-time:

Dependency Gentoo Name Debian/Ubuntu Name
wayland-protocols dev-libs/wayland-protocols wayland-protocols

Optional (for building man pages):

Dependency Gentoo Name Debian/Ubuntu Name
scdoc app-text/scdoc scdoc

Note for Gentoo Users

Beansprout is available in my personal ebuild repo and in GURU.

Build

Build and install with:

zig build -Doptimize=ReleaseSafe --prefix ~/.local install

Run zig build -h to see a list of all options.

Usage

You can either add beansprout to the river init file or directly run river -c beansprout.

If no keybinds are configured (e.g. missing or broken config), beansprout provides fallback keybinds including Ctrl+Alt+Delete to exit the River session, Super+Shift+R to reload config, and Super+T to spawn a terminal.

If beansprout crashes, you can use River's hardcoded Ctrl+Alt F1F12 bindings to switch to another TTY. From there, you can kill River or restart beansprout (you will need to set WAYLAND_DISPLAY yourself, e.g. WAYLAND_DISPLAY=wayland-1 beansprout).

Configuration

Beansprout is configured with a KDL file at $XDG_CONFIG_HOME/beansprout/config.kdl. See docs/CONFIGURATION.md for a full reference and examples/config.kdl for an example config.

Licensing

This project follows the REUSE Specification, all files have SPDX copyright and license information and/or are listed under REUSE.toml.

In overview:

  • beansprout's source code is released under the GPL-3.0-only license.
  • beansprout's documentation is released under the CC-BY-4.0 license.
  • beansprout's examples are released under the CC0-1.0 license.

All licenses can be found under LICENSES