From d82fa82a878e1b6973a508e6a2d2f042d1bf0ba2 Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Sun, 30 Nov 2025 23:50:39 +0100 Subject: [PATCH] Always add hostname last in the info line Signed-off-by: AnErrupTion --- src/main.zig | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main.zig b/src/main.zig index dffd8fe..276cb0b 100644 --- a/src/main.zig +++ b/src/main.zig @@ -405,19 +405,6 @@ pub fn main() !void { try log_writer.writeAll("x11 support disabled at compile-time\n"); } - if (config.initial_info_text) |text| { - try info_line.addMessage(text, config.bg, config.fg); - } else get_host_name: { - // Initialize information line with host name - var name_buf: [std.posix.HOST_NAME_MAX]u8 = undefined; - const hostname = std.posix.gethostname(&name_buf) catch |err| { - try info_line.addMessage(lang.err_hostname, config.error_bg, config.error_fg); - try log_writer.print("failed to get hostname: {s}\n", .{@errorName(err)}); - break :get_host_name; - }; - try info_line.addMessage(hostname, config.bg, config.fg); - } - var has_crawl_error = false; // Crawl session directories (Wayland, X11 and custom respectively) @@ -600,6 +587,19 @@ pub fn main() !void { try log_writer.print("failed to switch tty: {s}\n", .{@errorName(err)}); }; + if (config.initial_info_text) |text| { + try info_line.addMessage(text, config.bg, config.fg); + } else get_host_name: { + // Initialize information line with host name + var name_buf: [std.posix.HOST_NAME_MAX]u8 = undefined; + const hostname = std.posix.gethostname(&name_buf) catch |err| { + try info_line.addMessage(lang.err_hostname, config.error_bg, config.error_fg); + try log_writer.print("failed to get hostname: {s}\n", .{@errorName(err)}); + break :get_host_name; + }; + try info_line.addMessage(hostname, config.bg, config.fg); + } + while (run) { // If there's no input or there's an animation, a resolution change needs to be checked if (!update or animate) {