Skip to content

Conversation

JBTastic
Copy link

Problem:
On many laptops with multiple ACPI-reported batteries (e.g., Battery 0 and Battery 1), the current scripts incorrectly read the first battery’s status. Often, Battery 0 is a phantom or inactive battery reporting 0%, causing wrong battery percentage and remaining time displays.

Solution:
This patch modifies the battery detection logic in the tmux-battery scripts to:

  • Prefer the actual active battery (commonly Battery 1) by filtering out phantom batteries reporting 0%.
  • Update acpi command usage in all relevant scripts to ignore empty batteries.
  • Improve robustness across different hardware configurations.

Impact:
Users with laptops reporting multiple batteries will see accurate battery percentage and remaining time in tmux. This fix improves compatibility and usability significantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant