~andreafeletto/levee

3e383f3dbd3662b267ad6157c66efd2f70776155 — Andrea Feletto 11 days ago ee46a76
zig fmt
3 files changed, 5 insertions(+), 7 deletions(-)

M src/Wayland.zig
M src/main.zig
M src/modules/Pulse.zig
M src/Wayland.zig => src/Wayland.zig +1 -3
@@ 180,9 180,7 @@ fn bindGlobal(
    } else if (strcmp(iface, zwlr.LayerShellV1.getInterface().name) == 0) {
        const global = try registry.bind(name, zwlr.LayerShellV1, 1);
        self.setGlobal(global);
    } else if (
        strcmp(iface, zriver.StatusManagerV1.getInterface().name) == 0
    ) {
    } else if (strcmp(iface, zriver.StatusManagerV1.getInterface().name) == 0) {
        const global = try registry.bind(name, zriver.StatusManagerV1, 1);
        self.setGlobal(global);
    } else if (strcmp(iface, zriver.ControlV1.getInterface().name) == 0) {

M src/main.zig => src/main.zig +1 -1
@@ 56,7 56,7 @@ pub fn main() anyerror!void {
        } else if (mem.eql(u8, module_name, "pulse")) {
            try state.modules.register(Modules.Pulse);
        } else {
            std.log.err("unknown module: {s}", .{ module_name });
            std.log.err("unknown module: {s}", .{module_name});
            os.exit(1);
        }
    }

M src/modules/Pulse.zig => src/modules/Pulse.zig +3 -3
@@ 63,7 63,7 @@ fn print(self_opaque: *anyopaque, writer: Module.StringWriter) !void {
    if (self.muted) {
        try writer.print("   🔇   ", .{});
    } else {
        try writer.print("🔊   {d}%", .{ self.volume });
        try writer.print("🔊   {d}%", .{self.volume});
    }
}



@@ 171,7 171,7 @@ export fn serverInfoCallback(

    self.sink_name = mem.span(info.?.default_sink_name);
    self.sink_is_running = true;
    std.log.info("pulse: sink set to {s}", .{ self.sink_name });
    std.log.info("pulse: sink set to {s}", .{self.sink_name});

    _ = pulse.pa_context_get_sink_info_list(ctx, sinkInfoCallback, self_opaque);
}


@@ 214,7 214,7 @@ export fn sinkInfoCallback(
    if (!self.sink_is_running and is_running) {
        self.sink_name = sink_name;
        self.sink_is_running = true;
        std.log.info("pulse: sink set to {s}", .{ sink_name });
        std.log.info("pulse: sink set to {s}", .{sink_name});
    }

    self.volume = volume: {