mirror of
https://github.com/actuallymentor/battery.git
synced 2026-02-03 14:03:24 +00:00
Fix force discharge option for users using a shell other than zsh.
This commit is contained in:
@@ -667,9 +667,9 @@ if [[ "$action" == "maintain_synchronous" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Parse setting - could be single value or range
|
# Parse setting - could be single value or range
|
||||||
local lower_bound=""
|
lower_bound=""
|
||||||
local upper_bound=""
|
upper_bound=""
|
||||||
local is_range=false
|
is_range=false
|
||||||
|
|
||||||
if valid_percentage_range "$setting"; then
|
if valid_percentage_range "$setting"; then
|
||||||
# Range format: lower-upper
|
# 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
|
# Check if the user requested that the battery maintenance first discharge to the desired level
|
||||||
if [[ "$subsetting" == "--force-discharge" ]]; then
|
if [[ "$subsetting" == "--force-discharge" ]]; then
|
||||||
# Before we start maintaining the battery level, first discharge to the target level
|
# 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"
|
log "Triggering discharge to $discharge_target before enabling charging limiter"
|
||||||
$battery_binary discharge "$discharge_target"
|
$battery_binary discharge "$discharge_target"
|
||||||
log "Discharge pre battery-maintenance complete, continuing to battery maintenance loop"
|
log "Discharge pre battery-maintenance complete, continuing to battery maintenance loop"
|
||||||
|
|||||||
Reference in New Issue
Block a user