Jérémy
7504f22a0c
feat(battery): add wattage for macOS ( #13258 )
7 months ago
张新伟
5acaa240d3
feat(battery): support custom AC indicator ( #12528 )
2 years ago
not pua
0dc40e88a3
feat(battery): add support for OpenBSD ( #11872 )
3 years ago
Marc Cornellà
5fb204fa74
fix(battery): force battery percentage as integer
5 years ago
Marc Cornellà
9aeb967581
fix(battery): fix system check so Termux uses the correct method
5 years ago
Avneet Singh
f26a1ecdf0
feat(battery): add support for Android via Termux ( #9752 )
5 years ago
Ryan Voots
dc83d0b720
fix(battery): support `acpitool` and multiple batteries under Linux ( #9609 )
...
Co-authored-by: Marc Cornellà <hello@mcornella.com>
5 years ago
aimuz
5d8e1f8267
fix(battery): use `pmset` for battery percentage in macOS ( #9364 )
...
Returns the battery charge consistent with the system battery manager
5 years ago
Marc Cornellà
d6474237b8
battery: revert battery charging symbol 1-character-width hack
...
Fixes #8804
6 years ago
Marc Cornellà
2a081d6e5e
battery: remove printf usage where possible
...
Spares us of the need to quote % symbols
6 years ago
Marc Cornellà
3da469be5c
battery: fix Full battery bug on Linux; force 1-char-width on charging symbol
6 years ago
Marc Cornellà
3e9e385d98
battery: remove redundant grep calls in battery_pct function
6 years ago
Marc Cornellà
7290a08bf6
battery: fix floating point output in macOS
...
Fixes #8676
6 years ago
GregoireW
15a03744a9
Remove invalid batteries ( #8275 )
6 years ago
Bruce Weirdan
b8b8762915
Report only active battery ( #4726 )
...
On a system with multiple batteries (like thinkpads) report percentage
and time remaining only for the active battery (the one being
discharged).
Ideally we should report all batteries, but acpi only shows time remaining
for the active battery. Also callers of these functions expect a single
return value. This is still better than reporting 596% remaining (like it
did on my laptop).
For the reference, the output of acpi command with multiple batteries looks
like this:
Battery 0: Unknown, 5%
Battery 1: Discharging, 86%, 03:14:04 remaining
6 years ago
Marc Cornellà
5f6f7b6e8d
Various syntax fixes and function naming equivalence
...
- Fix code style
- Fix local definitions
- Don't declare unnecessary variables
- Use `command` before grep
6 years ago
Marc Cornellà
39e61614f2
Clean up Linux battery commands and syntax
6 years ago
Marc Cornellà
1bd7a7ad21
Fix calculation for battery percentage ( #4774 )
...
Co-authored-by: Michael Wolman <michael.s.wolman@gmail.com>
6 years ago
927589452
49c423c7e0
battery: add support for sysctl in FreeBSD ( #8155 )
7 years ago
guyzmo
8611aa8049
Fixing battery prompt formatting issue (cf #5894 ) ( #5895 )
...
Signed-off-by: Guyzmo <guyzmo+github+pub@m0g.net>
9 years ago
Hong
a56eac7a71
Use OSTYPE instead of uname whenever possible for better speed. ( #5496 )
10 years ago
Reed Riley
59c66dbfc2
Fix battery plugin when acpi writes to stderr ( #5413 )
...
* Fix battery plugin when acpi writes to stderr
* Make stderr redirection in battery plugin more idiomatic
10 years ago
Christian Höltje
63bae2aba9
Use $OSTYPE instead of uname to speed things up
...
The $OSTYPE variable is set at ZSH compile time and can be safely used
to determine the OS of the system. e.g. darwin (os x)
12 years ago
Reed Riley
fb2d6eb567
Fixed errors if acpitool isn't installed on linux
12 years ago
Thiago Perrotta
564a708d6a
added the linux implementation to the battery plugin
12 years ago
Chris Wiggins
fdd864bd5b
Update battery plugin to show calculating - OSX
...
Instantly after removing the charger, I have found that the "AvgTimeToEmpty" value can swing to rediculous values. Apple's current claim is that the max battery life is 12 hours, so any value larger than this is considered a "time is being calculated" value.
12 years ago
Brice Dutheil
cc8b09366b
Adds a method that print a battery gauge
...
It is especially useful for themes, this function is a port of the code written by Steve Losh
and made available on [this blog entry](http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/#my-right-prompt-battery-capacity )
12 years ago
James Seward
8cfc7d6677
Prevent errors in prompts if no info available.
...
Define empty functions instead of none at all if we can't figure out the
platform.
13 years ago
Ron Shapiro
ae1973de44
plugged_in function
13 years ago
Ron Shapiro
bc385531b0
Separate the battery_pct_remaining data into it's own function so that it can be obtained even if the battery is connected.
13 years ago
Sean Jones
fdd46d8815
Updated battery plugin. Displays charging time.
...
linux battery level now refreshes after every command
13 years ago
Sean Jones
5991bf3ac1
Fixed Kernel Detection in battery plugin
13 years ago
Sean Jones
e226fc048a
Added support for Mac to battery plugin
13 years ago
Peter Hoeg
6095fe4f71
add: battery plugin
15 years ago