Skip to content

Commit

Permalink
Fixed off-by-one error in _lp_battery()
Browse files Browse the repository at this point in the history
Resolves liquidprompt#476 and partially addresses liquidprompt#481
  • Loading branch information
overhacked committed May 8, 2018
1 parent b2e9f6a commit c3bb0a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion liquidprompt
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ case "$LP_OS" in
*) # "charging", "AC attached"
echo -nE "$percent"
# under => 2, above => 3
return $(( 1 + ( percent > LP_BATTERY_THRESHOLD ) ))
return $(( 2 + ( percent > LP_BATTERY_THRESHOLD ) ))
;;
esac
}
Expand Down

1 comment on commit c3bb0a2

@augmentedfourth
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 1295, for the Linux function, needs this change as well.

Please sign in to comment.