Commit graph

197 commits

Author SHA1 Message Date
Ben Buhse
6d4352a217
Implement floating windows
As of this commit, there's not-yet a way to resize or move floating
windows, but it's possible to create one and focus through all windows.

Floating windows are always above tiled windows and, if floating window
is focused, that window is always above any another floating windows.

Windows have a separate float_{x, y, width, height} to remember their
floating location if they go from float=>tiled=>float again.
2026-02-05 17:14:46 -06:00
Ben Buhse
fba4a3d087 Merge pull request 'Implement changeable primary count' (#8) from primary-count into main
Reviewed-on: https://codeberg.org/bwbuhse/beansprout/pulls/8
2026-02-04 22:49:39 +01:00
Ben Buhse
5ff05ab09e
Implement changeable primary count
There are new increment_primary_count and decrement_primary_count config options
2026-02-04 15:43:30 -06:00
Ben Buhse
26949d7b8a Merge pull request 'Add multi-output support' (#7) from multi-output-support into main
Reviewed-on: https://codeberg.org/bwbuhse/beansprout/pulls/7
2026-02-04 03:12:41 +01:00
Ben Buhse
0f85278aea
Add multi-output support
Primary ratio is per-output.

If an output is disconnected/disabled, its windows get sent to the
previous output in the output list. If all outputs are disconnected,
windows are added to an orphan list in the WM. Once an output is
re-added, the orphans are all given to that output.

When a window is sent to a new output, it keeps the same tags as it
had before. I may add an option to take the new output's tags.

- Rename focus_next/focus_prev to focus_next_window/focus_prev_window
- Add focus_next_output/focus_prev_output
- Add send_to_next_output/send_to_prev_output commands to move windows
    between outputs

Split Seat.PendingManage.PendingFocus into separate pending output
and pending window structs

Fix window outputs when closing outputs
2026-02-03 20:10:33 -06:00
Ben Buhse
342c0fdf8f Merge pull request 'Add support for reloading config' (#6) from config-reload into main
Reviewed-on: https://codeberg.org/bwbuhse/beansprout/pulls/6
2026-01-31 21:38:10 +01:00
Ben Buhse
4157dd67f6
Fix use-after-free by moving config-reload into the manage cycle 2026-01-31 14:08:46 -06:00
Ben Buhse
cd32463d52
Add a keybind to reload config; still needs more testing 2026-01-31 10:47:20 -06:00
Ben Buhse
365c000b6e
Add change_ratio keybind 2026-01-30 21:47:16 -06:00
Ben Buhse
4e02a07bf1
Implement zoom keybind 2026-01-30 21:09:02 -06:00
Ben Buhse
8ffbc3dbd1 Merge pull request 'Implement config' (#5) from config into main
Reviewed-on: https://codeberg.org/bwbuhse/beansprout/pulls/5
2026-01-31 03:35:01 +01:00
Ben Buhse
fd8b6d0d41
Implement configuration for keybindings
Keybinds go in a "keybinds" block and follow the format

<command> <modifiers> <keysym> <options>

But there's also a special "tag_bind" command that just takes modifiers
and one of set_output_tags, set_window_tags, toggle_output_tags, and
toggle_window_tags. It will automatically be used to loop through the
1-9 keys on tags 1<<0 to 1<<9, however, you can still implement those
commands individually if you want.
2026-01-30 20:33:16 -06:00
Ben Buhse
9b524b810d
Add helper functions for logging in Config.zig
logWarnInvalidNodeArg() can be used for when a node has an invalid type
for its argument.

logDebugSettingNode() prints the configuration name and the value being
set.
2026-01-27 18:37:15 -06:00
Ben Buhse
676ca40891
Actually use focus_follows_pointer and pointer_warp_on_focus_change 2026-01-27 15:30:30 -06:00
Ben Buhse
c4d2c40f1a
Fix Config.skipChildBlock()
Before, there would be issues for nested child blocks
2026-01-27 15:13:02 -06:00
Ben Buhse
43e3d268c9
Implement initial config loading
Config goes in $XDG_CONFIG_HOME/beansprout/config.kdl or
$HOME/.config/beansprout/config.kdl

Config is in the kdl format. Right now, the supported options are

```zig
/// Width of window borders in pixels
border_width: u8 = 2,
/// Color of focused window's border in 0xRRGGBBAA or 0xRRGGBB form
border_color_focused: RiverColor = utils.parseRgbaComptime("0x89b4fa"),
/// Color of uffocused windows' borders in 0xRRGGBBAA or 0xRRGGBB form
border_color_unfocused: RiverColor = utils.parseRgbaComptime("0x1e1e2e"),

/// Where a new window should attach, top or bottom of the stack
attach_mode: AttachMode = .top,
/// Should focus change when the cursor moves onto a new window
focus_follows_pointer: bool = true,
/// Should the pointer warp to the center of newly-focused windows
pointer_warp_on_focus_change: bool = true,
```

I plan to add Keybinds shortly. If parsing the configuration fails,
the default config will be used and the WM will continue loading.
2026-01-27 14:54:27 -06:00
Ben Buhse
726d346015 Merge pull request 'Implement tags' (#4) from tag-implementation into main
Reviewed-on: https://codeberg.org/bwbuhse/beansprout/pulls/4
2026-01-27 03:02:28 +01:00
Ben Buhse
9030de6b64
Get tags working with actual tag-switching support
I added 7 new Commands to XkbKeybinds.Commands, though 3 of them don't
work yet.

The new commands that *work* are

+    set_output_tags: u32,
+    set_window_tags: u32,
+    toggle_output_tags: u32,
+    toggle_window_tags: u32,

They each take a 32-bit value as a bitmask to set (or toggle) tags.

The 3 unimplemented commands are

+    spawn_tagmask: u32,
+    focus_previous_tags,
+    send_to_previous_tags,

and they will all panic if they're used.

For now, default keybinds are hardcoded as part of WindowManager's
initializing in the first \`manage_start\` event. Multi-output support
is not added yet, so this will still all happen on a single Output.
2026-01-26 17:44:34 -06:00
Ben Buhse
b8d31de3ef
Start adding tags
Right now, essentially nothing has changed, there is still no multi-
output support and not even a way to change/set/toggle/view/etc. tags.

However, tags *are* implemented at a core level. Next step is to add
keybinds for the various tag actions.

After that, I will work on multi-output support.
2026-01-26 15:04:41 -06:00
Ben Buhse
87ec2d4f60
Working on refactoring inits 2026-01-26 13:10:51 -06:00
Ben Buhse
67eef42bd8 Merge pull request 'Clean up some code, implement pointer-warp-on-focus-change, fix a crash' (#3) from pointer-warp-on-focus-change into main
Reviewed-on: https://codeberg.org/bwbuhse/beansprout/pulls/3
2026-01-26 04:00:57 +01:00
Ben Buhse
e1a0b89ced
Standardize panic messages and clean up code 2026-01-25 20:57:05 -06:00
Ben Buhse
c953fe3d68
Fix pointer warp for new and closed windows 2026-01-25 13:26:57 -06:00
Ben Buhse
bfa41f36b0
Add PendingState to Seat 2026-01-25 12:10:00 -06:00
Ben Buhse
137eac9364
Update comments; Check river.SeatV1 version; Prepend new windows 2026-01-24 18:23:13 -06:00
Ben Buhse
46938c238a Merge pull request 'Refactor initialization and Context struct' (#2) from context-refactor into main
Reviewed-on: https://codeberg.org/bwbuhse/beansprout/pulls/2
2026-01-25 00:52:05 +01:00
Ben Buhse
30231f1149
Refactor initialization and Context struct
I tried to make it a little bit easier to follow and get rid of the
need to call back to context.x.y.z (as much) [I hope]
2026-01-24 17:48:01 -06:00
Ben Buhse
92e82f38f5
Implement fullscreening 2026-01-24 14:45:33 -06:00
Ben Buhse
643d6c82ab
Merge branch 'maximize-and-fullscreen' 2026-01-23 20:04:29 -06:00
Ben Buhse
6fce659378
Add borders to windows; add navigation keybinds
Right now, colors are hardcoded in the Config in main.zig.

This commit also adds a couple of new keybinds for navigating between
windows. All keybinds are hardcoded as well right now.
2026-01-23 20:03:07 -06:00
Ben Buhse
578e2f449e
Add borders to windows; add navigation keybinds
Right now, colors are hardcoded in the Config in main.zig.

This commit also adds a couple of new keybinds for navigating between
windows. All keybinds are hardcoded as well right now.
2026-01-23 16:23:14 -06:00
Ben Buhse
42494ae5d1 Merge pull request 'Implement initial layout' (#1) from WIP into main
Reviewed-on: https://codeberg.org/bwbuhse/beansprout/pulls/1
2026-01-19 21:36:46 +01:00
Ben Buhse
480c2b1d00 Merge branch 'main' into WIP 2026-01-19 21:35:38 +01:00
Ben Buhse
61fd784246
Implement initial tiling layout.
For now, it's hardcoded to be a right-primary/stack layout (similar to
dwm but with the primary on the right) with the primary window getting
55% of the width of the screen.
2026-01-19 14:32:47 -06:00
Ben Buhse
2c18946703
Add river-xkb-bindings and implement Alt+T to open foot
This is the only keybind for now.
2026-01-19 14:32:46 -06:00
Ben Buhse
a69d647f0c
Update to latest protocol version 2026-01-19 14:32:46 -06:00
Ben Buhse
0c27b99aa6
Update example/init slightly 2026-01-19 14:32:36 -06:00
Ben Buhse
cf0cddb8f9
Update to latest protocol version 2026-01-18 18:35:39 -06:00
Ben Buhse
8c841a817c
WIP 2025-10-06 19:31:17 -05:00
Ben Buhse
b541681ca1
Update protocol to latest version 2025-10-04 11:54:44 -05:00
Ben Buhse
5f53ffc3ad
Upgrade to zig 0.15.1 2025-10-02 17:13:32 -05:00
Ben Buhse
8304734230
Closing windows is no longer a segfault 2025-08-05 18:57:16 -05:00
Ben Buhse
f65a9aaf12
Remove event_loop/Backend 2025-08-05 18:57:07 -05:00
Ben Buhse
9d64ca0124
Add focus to my single window 2025-08-03 20:49:06 -05:00
Ben Buhse
bad5007670
Display a single window! 2025-08-03 09:31:27 -05:00
Ben Buhse
c87fa2d4af
Begin setting up infrastructure for the WM
Mostly just created the very basic Wayland connection needed, but I also
bind to the rwm protocol which is neat.
2025-05-06 21:47:22 -05:00
Ben Buhse
8eec239af6
initial commit 2025-05-03 21:07:26 -05:00