From 1f2453f0fb0a5fea005625112eb9df4aa80bace4 Mon Sep 17 00:00:00 2001 From: Matthew Rothlisberger Date: Wed, 15 Oct 2025 13:58:04 +0200 Subject: [PATCH] Disable battery status display by default (#852) A couple things to fix in the new battery status display configuration. I think this should be disabled by default. My reasoning: - Historically a conservative approach is taken with new capabilities in Ly; even the clock is disabled by default - The existing default creates a regression (error message) for anyone without `/sys/class/power_supply/BAT0` on their system (all non-portable PCs, and laptops that use a different identifier) - The battery status check causes animations to momentarily hang at a regular interval Other changes: - Comment for `battery_id` aligned with similar config switch comments (description / useful information / effect of null setting) - `battery_id` moved to its correct alphabetical position in the config file - Setting aligned between `Config.zig` and `config.ini` (the prototypical config file should reflect the actual default) - Configurations prefixed with `hide_` alphabetized Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/852 Reviewed-by: AnErrupTion Co-authored-by: Matthew Rothlisberger Co-committed-by: Matthew Rothlisberger --- res/config.ini | 13 +++++++------ src/config/Config.zig | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/res/config.ini b/res/config.ini index 5d2d03e..17503fe 100644 --- a/res/config.ini +++ b/res/config.ini @@ -41,6 +41,11 @@ asterisk = * # The number of failed authentications before a special animation is played... ;) auth_fails = 10 +# Identifier for battery whose charge to display at top left +# Primary battery is usually BAT0 or BAT1 +# If set to null, battery status won't be shown +battery_id = null + # Background color id bg = 0x00000000 @@ -183,15 +188,11 @@ gameoflife_initial_density = 0.4 # 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 -# Set to null to disable battery status display -# Default is BAT0, the typical identifier for the primary battery -battery_id = null +# Remove version number from the top left corner +hide_version_string = false # Initial text to show on the info line # If set to null, the info line defaults to the hostname diff --git a/src/config/Config.zig b/src/config/Config.zig index 4dfab4d..53cc3c8 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -11,6 +11,7 @@ animation: Animation = .none, animation_timeout_sec: u12 = 0, asterisk: ?u32 = '*', auth_fails: u64 = 10, +battery_id: ?[]const u8 = null, bg: u32 = 0x00000000, bigclock: Bigclock = .none, bigclock_12hr: bool = false, @@ -47,9 +48,8 @@ gameoflife_entropy_interval: usize = 10, gameoflife_frame_delay: usize = 6, gameoflife_initial_density: f32 = 0.4, hide_borders: bool = false, -hide_version_string: bool = false, hide_key_hints: bool = false, -battery_id: ?[]const u8 = "BAT0", +hide_version_string: bool = false, initial_info_text: ?[]const u8 = null, input_len: u8 = 34, lang: []const u8 = "en",