From 62464b19c827aaf2a858e21584857445a98a92eb Mon Sep 17 00:00:00 2001 From: Jackson Delahunt Date: Mon, 30 Mar 2026 12:01:47 +1100 Subject: [PATCH] config: address review feedback for show_tty - Move show_tty field to correct alphabetical position in Config.zig (after show_password_key, before shutdown_cmd) - Add blank line before tty_label_width for readability --- src/config/Config.zig | 2 +- src/main.zig | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config/Config.zig b/src/config/Config.zig index 09d825f..c0a4350 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -84,6 +84,7 @@ service_name: [:0]const u8 = "ly", session_log: ?[]const u8 = "ly-session.log", setup_cmd: []const u8 = build_options.config_directory ++ "/ly/setup.sh", show_password_key: []const u8 = "F7", +show_tty: bool = false, shutdown_cmd: []const u8 = "/sbin/shutdown -a now", shutdown_key: []const u8 = "F1", sleep_cmd: ?[]const u8 = null, @@ -92,7 +93,6 @@ start_cmd: ?[]const u8 = null, text_in_center: bool = false, vi_default_mode: ViMode = .normal, vi_mode: bool = false, -show_tty: bool = false, waylandsessions: ?[]const u8 = build_options.prefix_directory ++ "/share/wayland-sessions", x_cmd: []const u8 = build_options.prefix_directory ++ "/bin/X", x_vt: ?u8 = null, diff --git a/src/main.zig b/src/main.zig index 4040cb6..08c5177 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1941,6 +1941,7 @@ fn positionWidgets(ptr: *anyopaque) !void { .add(TerminalBuffer.START_POSITION) .addYFromIf(state.brightness_up_label.childrenPosition(), !state.config.hide_key_hints) .removeYFromIf(state.edge_margin, !state.config.hide_key_hints)); + const tty_label_width = if (state.config.show_tty) TerminalBuffer.strWidth(state.tty_label.text) else 0; const tty_label_gap = if (state.config.show_tty and state.config.clock != null) @as(usize, 1) else 0; state.tty_label.positionXY(state.edge_margin