valr / cbatticon

A lightweight and fast battery icon that sits in your system tray
GNU General Public License v2.0
170 stars 40 forks source link

notification spam after upgrade to 1.6.4 #30

Closed JonnyJD closed 7 years ago

JonnyJD commented 8 years ago

I had cbatticon running (one instance for every battery in my x240) with 1.5.0 and it worked well. I got notifications (using notification-daemon) only when things changed.

I updated to cbatticon 1.6.4 today and I get the notification "Battery is charged!" every second (having my laptop "plugged into the wall").

Downgrading to 1.5.0 fixed the issue again. So there must be something wrong with one of the few changes. I can't run bisect ATM, but I might be able to do that later.

My other stats: Arch Linux, kernel 4.5.1, lenovo thinkpad x240

running cbatticon -d BAT0

ac path: /sys/class/power_supply/AC
workaround: current rate is not available, estimating rate
battery path: /sys/class/power_supply/BAT0
battery present: 1
battery status: 1 - Unknown
ac online: 1
battery string: Battery is charged!
tooltip: Battery is charged!
icon name: battery-full-charged

My current workaround is using the -n flag to hide all notifications.

valr commented 8 years ago

Argh, that's not good. Thanks for reporting this.

Let me check the difference between the two versions regarding the notifications. If I need more informations I'll let you know.

valr commented 8 years ago

Ok, I've finally found some time to look at this. I've found the bug and it's an error when detecting if there was a change in the power supplies (battery or ac).

You have that error because you have more than one battery. I don't have a laptop with 2 batteries so couldn't test that case.

I'll see how to fix it.

codemac commented 7 years ago

Same thing is happening here. Let me know if there was a fix put in that needs to be tested.

codemac commented 7 years ago

Pushed #37 to fix this issue. Works locally for me.

valr commented 7 years ago

Fix has been merged. I'm preparing a new release now.