Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

battery regexp breaks with two batteries #464

Open
iwkse opened this issue Jun 10, 2022 · 1 comment
Open

battery regexp breaks with two batteries #464

iwkse opened this issue Jun 10, 2022 · 1 comment

Comments

@iwkse
Copy link

iwkse commented Jun 10, 2022

With a lenovo thinkpad:

$ acpi -b Battery 0: Not charging, 97% Battery 1: Discharging, 19%, 01:21:13 remaining
the current regexp can't match "Not charging"

# fail on unexpected output if ($acpi !~ /: (\w+), (\d+)%/) { die "$acpi\n"; }
Fixes that works also for double batteries:

# fail on unexpected output if ($acpi !~ /: (\w+\s*)*, (\d+)%/) { die "$acpi\n"; }

@scrambledlegs
Copy link

Thanks for this fix! I had the same issue on an old T450s

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

No branches or pull requests

2 participants