Add initial bar support

Right now it just renders a black bar at the top of the screen, nothing
useful is in it and it has no configuration.
This commit is contained in:
Ben Buhse 2026-02-13 10:07:48 -06:00
commit 40088b4ab6
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
5 changed files with 345 additions and 26 deletions

View file

@ -36,6 +36,7 @@ const usage: []const u8 =
\\
;
// TODO: I'd like to clean this function up a bit and move some bits into helpers
pub fn main() !void {
const result = flags.parser([*:0]const u8, &.{
.{ .name = "h", .kind = .boolean },
@ -78,6 +79,16 @@ pub fn main() !void {
}
}
// Initialize fcft
const fcft_log_level: fcft.LogClass = switch (runtime_log_level) {
.err => .err,
.warn => .warning,
.info => .info,
.debug => .debug,
};
_ = fcft.init(.auto, false, fcft_log_level);
defer fcft.fini();
const wayland_display_var = try utils.gpa.dupeZ(u8, process.getEnvVarOwned(utils.gpa, "WAYLAND_DISPLAY") catch {
fatal("Error getting WAYLAND_DISPLAY environment variable. Exiting", .{});
});
@ -246,6 +257,7 @@ const wayland = @import("wayland");
const river = wayland.client.river;
const wl = wayland.client.wl;
const zwlr = wayland.client.zwlr;
const fcft = @import("fcft");
const flags = @import("flags.zig");
const utils = @import("utils.zig");