Comments (13)
@FMMazur thank you for submitting this issue.
This relates to #7
This is interesting; I assumed that if a user had multiple batteries it would be okay to show the average, assuming they are all laptop power. But I see that other batteries show up and it makes no sense. I will make an update soon to show only the first battery power.
from battery.nvim.
Yes just updated it this morning. Please grab the latest or set the tag to v.0.5.0 and let me know if it is fixed. The new behaviour takes the first battery found.
from battery.nvim.
I found something in MSDN, it says, the device can send the _SUN method as specified on ACPI Reference. So it can be a firmware that don't send that optional method or it could be some driver problem as related at this reddit post.
from battery.nvim.
Now it works perfectly!! Thanks a lot, I truly appreciate the effort!
from battery.nvim.
Is there an update on this issue? I have the exact same problem
from battery.nvim.
I believe that the way it is implemented in the commit may not always works, I will check it later.
from battery.nvim.
I may have to make it either display multiple batteries or pick one based on some criteria. Let me know if you see any documentation on how acpi reports.
Another option, which is less satisfying for the user, would be to have a configurable battery number (take the 1st, 2nd or 3rd and so on)
from battery.nvim.
It still has some issues.
The order of the batteries is not always the same, which makes it sometimes show 0%
from battery.nvim.
I don't really know how to program in Lua so I have no idea how to implement this, but in /sys/class/power_supply/BAT0/
there is a file called capacity
which stores the battery percentage
from battery.nvim.
@netfri25 thanks for the info. I think the problem with using the file system is that it varies across different linux distributions, whereas the if I require the user to install acpi that levels the playing field. Unfortunately I don't have any idea how acpi orders the batteries so not sure how to pick one.
from battery.nvim.
I'm going to add a new configuration variable 'multiple_battery_selection'
- "max" will choose the battery with the highest percentage power
- "avg" will average the battery percentages
- 1,2,3... will choose the first, second, third battery reported
It will default to 1 so the existing behaviour will be unchanged.
This will initially only be implemented for linux/acpi.
from battery.nvim.
I've implemented the multiple_battery_selection option in the branch battery-chooser
.
battery.setup({
update_rate_seconds = 30, -- Number of seconds between checking battery status
show_status_when_no_battery = true, -- Don't show any icon or text when no battery found (desktop for example)
show_plugged_icon = true, -- If true show a cable icon alongside the battery icon when plugged in
show_unplugged_icon = true, -- When true show a diconnected cable icon when not plugged in
show_percent = true, -- Whether or not to show the percent charge remaining in digits
vertical_icons = true, -- When true icons are vertical, otherwise shows horizontal battery icon
multiple_battery_selection = 1, -- Which battery to choose when multiple found. "max" or "maximum", "min" or "minimum" or a number to pick the nth battery found (currently linux acpi only)
})
I don't have a linux machine handy to test this on so I'm not ready to push to main, but if anyone can verify that it works and helps with this issue I will do so.
from battery.nvim.
@netfri25 in your case I would set multiple_battery_selection = max,
so that you always get the battery that is charged not the 0%.
from battery.nvim.
Related Issues (20)
- Optional customization option for advanced users - format string
- replace 'kyazdani42/nvim-web-devicons' by 'nvim-tree/nvim-web-devicons' HOT 1
- Handle multiple batteries - Windows/Powershell
- Weird error in Linux. HOT 2
- Why is the plugin using `acpi` instead of the `/sys/class/power_supply/` files? HOT 5
- feat: checkhealth should check what method is being used for battery information
- bug: health module is in the wrong place HOT 1
- feat: use `termux-battery-status` if it is available HOT 1
- meta: enable "discussions" feature on Github HOT 1
- question: is "bit" a module that everyone has? HOT 1
- bug? (not really): inconsistent practices HOT 2
- refactor: move parsers to a submodule, and include condition functions in parser modules HOT 4
- bug: `util.file.is_readable_directory()` does not work on Termux HOT 4
- feat: add `advice` list to error health check
- docs: error in documentation ("min" `multiple_battery_selection`) HOT 1
- docs: help pages not available by default HOT 1
- docs: add type hints
- Error on my Windows device with no battery HOT 46
- feat: add option to force a specific method
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from battery.nvim.