From 3504180e955b8c680aa591a139bd025e4689a555 Mon Sep 17 00:00:00 2001 From: Dusan Date: Tue, 10 Jun 2025 06:12:48 +0200 Subject: [PATCH 1/2] Option to hide version string --- res/config.ini | 3 +++ src/config/Config.zig | 1 + src/main.zig | 9 ++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/res/config.ini b/res/config.ini index 53050e4..7e2c7eb 100644 --- a/res/config.ini +++ b/res/config.ini @@ -128,6 +128,9 @@ fg = 0x00FFFFFF # Remove main box borders hide_borders = false +# Remove version number from the top left corner +hide_version_string = false + # Remove power management command hints hide_key_hints = false diff --git a/src/config/Config.zig b/src/config/Config.zig index c0f3411..99d7162 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -37,6 +37,7 @@ error_bg: u32 = 0x00000000, error_fg: u32 = 0x01FF0000, fg: u32 = 0x00FFFFFF, hide_borders: bool = false, +hide_version_string: bool = false, hide_key_hints: bool = false, initial_info_text: ?[]const u8 = null, input_len: u8 = 34, diff --git a/src/main.zig b/src/main.zig index 70d0191..2906297 100644 --- a/src/main.zig +++ b/src/main.zig @@ -422,9 +422,14 @@ pub fn main() !void { if (auth_fails < config.auth_fails) { _ = termbox.tb_clear(); + var length: usize = 0; + if (!animation_timed_out) animation.draw(); - buffer.drawLabel(ly_top_str, 0, 0); + if (!config.hide_version_string) { + buffer.drawLabel(ly_top_str, 0, 0); + length += ly_top_str.len + 1; + } if (config.bigclock != .none and buffer.box_height + (bigclock.HEIGHT + 2) * 2 < buffer.height) draw_big_clock: { const format = "%H:%M"; @@ -485,8 +490,6 @@ pub fn main() !void { info_line.label.draw(); if (!config.hide_key_hints) { - var length: usize = ly_top_str.len + 1; - buffer.drawLabel(config.shutdown_key, length, 0); length += config.shutdown_key.len + 1; buffer.drawLabel(" ", length - 1, 0); From 14aae40fda912b33f059c1bc293135b01ecd16e4 Mon Sep 17 00:00:00 2001 From: Dusan Date: Tue, 10 Jun 2025 14:34:20 +0200 Subject: [PATCH 2/2] Use existing label value for x --- src/main.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.zig b/src/main.zig index 2906297..9e41dc2 100644 --- a/src/main.zig +++ b/src/main.zig @@ -427,7 +427,7 @@ pub fn main() !void { if (!animation_timed_out) animation.draw(); if (!config.hide_version_string) { - buffer.drawLabel(ly_top_str, 0, 0); + buffer.drawLabel(ly_top_str, length, 0); length += ly_top_str.len + 1; }