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

acpi should take precedence in battery #541

Merged
merged 3 commits into from
Nov 20, 2018

Conversation

Snuggle
Copy link
Contributor

@Snuggle Snuggle commented Oct 25, 2018

Description

Shuffled battery section around, should fix issue #526. acpi seems to give a nicer output than upower and doesn't give a bunch of extra battery/peripheral devices that are hard to filter. If acpi returns 0% charge, the device is likely a desktop without a battery.

Changes haven't been tested yet, testing yourself would be appreciated!

Fix #526

Co-authored-by: Maxim Baz <git@maximbaz.com>
Copy link
Member

@salmanulfarzy salmanulfarzy left a comment

Choose a reason for hiding this comment

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

Thanks @Snuggle for PR.

It might be better if we swap order between acpi and upower, and leave pmset as it is. Like pmsetacpiupower. Looks like you missed the variable used in conditional.

This needs testing 🛠️

sections/battery.zsh Outdated Show resolved Hide resolved
sections/battery.zsh Outdated Show resolved Hide resolved
@salmanulfarzy salmanulfarzy added the improvement A PR that make small changes for improving UX, performance, readability, etc label Oct 25, 2018
@salmanulfarzy salmanulfarzy changed the title acpi -b should take precedence! (Fixes #526) acpi should take precedence in battery Oct 25, 2018
sections/battery.zsh Outdated Show resolved Hide resolved
Copy link
Member

@salmanulfarzy salmanulfarzy left a comment

Choose a reason for hiding this comment

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

I haven't locally tested this, But code look good 👍

@Snuggle
Copy link
Contributor Author

Snuggle commented Nov 5, 2018

In the meantime, could I please ask for some documentation on how to actually locally run your tests? I just get some npm error about some shintango2 package or something not being installed from ./scripts/tests.sh. I can't seem to install it with npm either.

@salmanulfarzy
Copy link
Member

about some shintango2 package or something not being installed

😆 We depend on kward/shunit2 for testing as submodule.

  1. Update submodules in your fork (via git submodule update --init --recursive)

CONTRIBUTING.md#setup

After that npm test should work fine. Let us know if you've any trouble after that.

@denysdovhan
Copy link
Member

Any progress on this? I'd like to merge this.

@Snuggle
Copy link
Contributor Author

Snuggle commented Nov 20, 2018

@denysdovhan — Just waiting for a second person to test & review, I believe.
There's nothing else to progress on, this pull request is finished & waiting.

@denysdovhan
Copy link
Member

@Snuggle good. I'm merging this.

P.S: I'll be grateful for a PR with some tests for battery section.

@denysdovhan denysdovhan merged commit 00c259d into spaceship-prompt:master Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement A PR that make small changes for improving UX, performance, readability, etc
Development

Successfully merging this pull request may close these issues.

Battery percentage is shown for a peripheral device.
3 participants