From 8761f97a0e5778b0b3f93f7de153a95950203b20 Mon Sep 17 00:00:00 2001 From: base47 Date: Wed, 19 Nov 2025 22:00:39 +0100 Subject: [PATCH] Fix force discharge option for users using a shell other than zsh. --- battery.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/battery.sh b/battery.sh index 1b1d7fb..aa0066a 100755 --- a/battery.sh +++ b/battery.sh @@ -667,9 +667,9 @@ if [[ "$action" == "maintain_synchronous" ]]; then fi # Parse setting - could be single value or range - local lower_bound="" - local upper_bound="" - local is_range=false + lower_bound="" + upper_bound="" + is_range=false if valid_percentage_range "$setting"; then # Range format: lower-upper @@ -689,7 +689,7 @@ if [[ "$action" == "maintain_synchronous" ]]; then # Check if the user requested that the battery maintenance first discharge to the desired level if [[ "$subsetting" == "--force-discharge" ]]; then # Before we start maintaining the battery level, first discharge to the target level - local discharge_target="$lower_bound" + discharge_target="$lower_bound" log "Triggering discharge to $discharge_target before enabling charging limiter" $battery_binary discharge "$discharge_target" log "Discharge pre battery-maintenance complete, continuing to battery maintenance loop"