This made my battery icon disappear when my Thinkpad is not charging because of the battery charging lock. Wouldn't that be considered a breaking change?
https://codeberg.org/dnkl/yambar/commit/8709e8da3835f5954f5d8d577035f76e68f82353
This made my battery icon disappear when my Thinkpad is not charging because of the battery charging lock. Wouldn't that be considered a breaking change?
Can you check which state it's in? Chances are it's a state yambar doesn't recognize at all, thus falling back to "unknown".
/sys/class/power_supply/<battery name>/status
Can you check which state it's in? Chances are it's a state yambar doesn't recognize at all, thus falling back to "unknown".
`/sys/class/power_supply/<battery name>/status`
I'll check later, but my problem is that before, it defaulted to "discharging" while now it defaults to "unknown" which makes it hide the battery from my bar.
I'll check later, but my problem is that before, it defaulted to "discharging" while now it defaults to "unknown" which makes it hide the battery from my bar.
Does it remain gone forever, or does it come back later?
While I think it's a good idea to refrain from breaking changes in general, in this case the "breaking" change was a bug fix. It also sounds as if your battery behaves weirdly. Thus, I don't think reverting 8709e8da38 is justified.
You should be able to revert to the old behavior with a simple config change. Something like this (untested):
> which makes it hide the battery from my bar.
Does it remain gone forever, or does it come back later?
While I think it's a good idea to refrain from breaking changes in general, in this case the "breaking" change was a bug fix. It also sounds as if your battery behaves weirdly. Thus, I don't think reverting https://codeberg.org/dnkl/yambar/commit/8709e8da3835f5954f5d8d577035f76e68f82353 is justified.
You should be able to revert to the old behavior with a simple config change. Something like this (untested):
```diff
diff --git a/examples/configurations/laptop.conf b/examples/configurations/laptop.conf
index 19d0bb4..7a51786 100644
--- a/examples/configurations/laptop.conf
+++ b/examples/configurations/laptop.conf
@@ -248,11 +248,10 @@ bar:
- battery:
name: BAT0
poll-interval: 30
- content:
- map:
- tag: state
- values:
- discharging:
+ anchors:
+ discharging: &discharging
+ list:
+ items:
- ramp:
tag: capacity
items:
@@ -267,6 +266,14 @@ bar:
- string: {text: , font: *awesome}
- string: {text: , foreground: 00ff00ff, font: *awesome}
- string: {text: "{capacity}% {estimate}"}
+ content:
+ map:
+ tag: state
+ values:
+ unknown:
+ <<: *discharging
+ discharging:
+ <<: *discharging
charging:
- string: {text: , foreground: 00ff00ff, font: *awesome}
- string: {text: "{capacity}% {estimate}"}
```
I think I exaggerated with having it reverted. Yes, I know, a very trivial config change fixes it. I will try to get the proper status though next time it goes "unknown"
I think I exaggerated with having it reverted. Yes, I know, a very trivial config change fixes it. I will try to get the proper status though next time it goes "unknown"
Not sure if there's anything more yambar can do here? Is there some thinkpad specific sysfs file we could look at?
If not, I think the best solution is to update the config. I've already pushed an update to the example conf.
Not sure if there's anything more yambar can do here? Is there some thinkpad specific sysfs file we could look at?
If not, I think the best solution is to update the config. I've already pushed an update to the example conf.
I just noticed I have a similar (or same even?) issue; my battery switches to "unknown" while charging after reaching 90% or so. In my case, mapping this to discharging is wrong, since it is charging - it eventually reaches the "full" state.
What I'll do is simply treat "unknown" as "almost full - consider unplugging" in my config, and maybe use a different color.
I've been looking around at other projects, and this appears to be an issue that pops up every now and then. Some solutions I saw were quite elaborate, looking at the AC status plus capacity stats and trying to guess the battery state. I'd rather not go there...
However, I do think we should document this in the man page.
I just noticed I have a similar (or same even?) issue; my battery switches to "unknown" while charging after reaching 90% or so. In my case, mapping this to discharging is wrong, since it _is_ charging - it eventually reaches the "full" state.
What I'll do is simply treat "unknown" as "almost full - consider unplugging" in my config, and maybe use a different color.
I've been looking around at other projects, and this appears to be an issue that pops up every now and then. Some solutions I saw were quite elaborate, looking at the AC status plus capacity stats and trying to guess the battery state. I'd rather not go there...
However, I do think we should document this in the man page.
8709e8da38
This made my battery icon disappear when my Thinkpad is not charging because of the battery charging lock. Wouldn't that be considered a breaking change?
Can you check which state it's in? Chances are it's a state yambar doesn't recognize at all, thus falling back to "unknown".
/sys/class/power_supply/<battery name>/status
I'll check later, but my problem is that before, it defaulted to "discharging" while now it defaults to "unknown" which makes it hide the battery from my bar.
Does it remain gone forever, or does it come back later?
While I think it's a good idea to refrain from breaking changes in general, in this case the "breaking" change was a bug fix. It also sounds as if your battery behaves weirdly. Thus, I don't think reverting
8709e8da38
is justified.You should be able to revert to the old behavior with a simple config change. Something like this (untested):
I think I exaggerated with having it reverted. Yes, I know, a very trivial config change fixes it. I will try to get the proper status though next time it goes "unknown"
It's just how Thinkpad's battery charging limit behaviour works.
Not sure if there's anything more yambar can do here? Is there some thinkpad specific sysfs file we could look at?
If not, I think the best solution is to update the config. I've already pushed an update to the example conf.
Yes, I agree.
I just noticed I have a similar (or same even?) issue; my battery switches to "unknown" while charging after reaching 90% or so. In my case, mapping this to discharging is wrong, since it is charging - it eventually reaches the "full" state.
What I'll do is simply treat "unknown" as "almost full - consider unplugging" in my config, and maybe use a different color.
I've been looking around at other projects, and this appears to be an issue that pops up every now and then. Some solutions I saw were quite elaborate, looking at the AC status plus capacity stats and trying to guess the battery state. I'd rather not go there...
However, I do think we should document this in the man page.
Man page updated in
58038a4236
Yes, I set mine as charging as it is still plugged in but it is "locked".