-
Notifications
You must be signed in to change notification settings - Fork 520
Questions about BAT0 or BAT1 in battery.sh #455
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
Comments
Oh look at that. It looks like this code should be a bit smarter and not just assume two names (BAT0 or BAT1): tmux-powerline/segments/battery.sh Lines 107 to 109 in 59b7648
We could look for these most common names (BAT0 or BAT1), or else pick the one other battery name (if any) if those two first one does not exist. Would you be willing to make a PR? :) |
This has been closed accidentally. The issue is about I see two reasonable approaches
while read bat; do
local full="$bat/charge_full"
local now="$bat/charge_now"
...
done <<<$(grep -l "Battery" /sys/class/power_supply/*/type | sed -e 's,/type$,,')
for bat in /sys/class/power_supply/{BAT,CMB}*; do
... Of course i'll recommend 1., will make a PR as soon as we're aligned. |
Oh yes you are correct, I incorrectly linked this issue to the mentioned PR. Sorry! Thanks for noticing:) |
it doesn't exist on my lattop (LG, Ubuntu 24.04 and Ubuntu 20.04). My laptop only has CMB0. I replaced BAT0 in .sh with CMB0 to make it work properly.
The text was updated successfully, but these errors were encountered: