Split main() up by adding parseArgs() and run()

parseArgs() contains all of the argument parsing logic in a single fn.

run() handles the event loop. To work with the bar, I had to re-write
the loop to use polling similar to the loop in `beanclock` instead of
just `while (true) dispatch`.
This commit is contained in:
Ben Buhse 2026-02-13 11:10:42 -06:00
commit 5501ccbe26
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
3 changed files with 125 additions and 48 deletions

View file

@ -107,7 +107,6 @@ pub fn destroy(libinput_device: *LibinputDevice) void {
fn riverLibinputDeviceV1Listener(river_libinput_device_v1: *river.LibinputDeviceV1, event: river.LibinputDeviceV1.Event, libinput_device: *LibinputDevice) void {
assert(libinput_device.river_libinput_device_v1 == river_libinput_device_v1);
const im = libinput_device.context.im;
log.debug("bwbuhse: {s} for {d}", .{ @tagName(event), river_libinput_device_v1.getId() });
switch (event) {
.removed => {
river_libinput_device_v1.destroy();