You are not logged in.

#1 2020-01-05 15:26:34

ciko2283
Member
Registered: 2019-12-21
Posts: 17

[SOLVED] Prolem with the power manager notifications on a laptop

Thinkpad T420

Stock Xfce power manager

When my battery is fully charged, i keep getting notifications that its full, and a few secons later that its charging, and then full again.
My battery doesnt last too long, so when im working on something these notifications get really annoying.
I know i can disable them, but then i dont know when my battery is empty.

Is there a fix for this? Or is there some alternative power manager that doesnt have this problem?

Last edited by ciko2283 (2020-01-10 21:36:20)

Offline

#2 2020-01-05 17:05:33

damo
....moderator....
Registered: 2015-08-20
Posts: 5,970

Re: [SOLVED] Prolem with the power manager notifications on a laptop

I bet the problem is with your hardware, in that case. You should get a single notification when it is full, but if it constantly charges/recharges then that would produce the notifications.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#3 2020-01-05 18:37:44

ciko2283
Member
Registered: 2019-12-21
Posts: 17

Re: [SOLVED] Prolem with the power manager notifications on a laptop

damo wrote:

I bet the problem is with your hardware, in that case. You should get a single notification when it is full, but if it constantly charges/recharges then that would produce the notifications.

Is there a way to make some kind of a "buffer", maybe between 98% and 100%, of battery, or 2 minutes from showing the last notification, so it doesn't spam me with notifications? Or to turn of notifications only for full and charging, but leave for almost empty? I turned them off for now and I'm checking when im on battery, but i wish i had some kind of a fix.

Offline

#4 2020-01-05 21:27:09

Uooops
Member
Registered: 2019-07-08
Posts: 16

Re: [SOLVED] Prolem with the power manager notifications on a laptop

Maybe you should replace your battery with a new one. It seems it's going to die soon and that's why you have this problem

Offline

#5 2020-01-05 22:18:13

damo
....moderator....
Registered: 2015-08-20
Posts: 5,970

Re: [SOLVED] Prolem with the power manager notifications on a laptop

A quick workaround may be to get conky to run a script every, say, 300 seconds. You could then turn off notifications in the power manager, and just get notified when the power is less than x%.

#!/bin/bash
##
## battery

LOW_CHARGE=10

charge=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | awk '{print $2}')
charge=${charge%'%'*}

echo "Remaining battery = ${charge}%"
(( charge < ${LOW_CHARGE} )) && notify-send "Low charge!"

exit

You can also install acpi to get battery information.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#6 2020-01-06 00:18:09

hhh
Meep!
Registered: 2015-09-17
Posts: 9,575
Website

Re: [SOLVED] Prolem with the power manager notifications on a laptop

Another option, disable battery notifications in the General>Appearance>Status Notifications screen of xfce4-power-manager-settings until you get a new battery.

Offline

#7 2020-01-06 00:35:41

hhh
Meep!
Registered: 2015-09-17
Posts: 9,575
Website

Re: [SOLVED] Prolem with the power manager notifications on a laptop

Oops, you thought of that...

ciko2283 wrote:

I know i can disable them, but then i dont know when my battery is empty.

But you can get an estimate of how much battery life you have by timing how long till it dies and then recharge well before that. And then buy a battery.

Offline

#8 2020-01-06 02:15:53

cog
Cattle Baron
From: New Mexico, USA
Registered: 2015-10-27
Posts: 452
Website

Re: [SOLVED] Prolem with the power manager notifications on a laptop

I use my own setup using systemd and a script instead of an XDG power manager.

It doesn't do notifications for power but will shut you down at 10%  and also lock your screen.

https://github.com/willscreel/dotfiles
https://github.com/willscreel/sysconfigs

My setup uses i3lock-fancy-rapid but can also be done with BunsenLabs built in "slock" if you remove forking from the suspend@ service.

Last edited by cog (2020-01-06 02:26:45)


Morning, Bunny.  Well, I can see you're in good health.  -George Washington McLintock! (John Wayne, AKA the Duke)

Offline

#9 2020-01-06 12:24:50

ohnonot
...again
Registered: 2015-09-29
Posts: 4,511
Website

Re: [SOLVED] Prolem with the power manager notifications on a laptop

ciko2283 wrote:

When my battery is fully charged, i keep getting notifications that its full, and a few secons later that its charging, and then full again.

It sounds like maybe the connection between charger and laptop is loose?
It really sounds like something that should not happen even with a degraded battery.

Maybe you can find sth in the logs?


BL quote proposals to this thread please.
how to ask smart questions | my repos / my repos | my blog
---
Thank you for posting direct image links!

Offline

#10 2020-01-06 22:13:12

ciko2283
Member
Registered: 2019-12-21
Posts: 17

Re: [SOLVED] Prolem with the power manager notifications on a laptop

damo wrote:

A quick workaround may be to get conky to run a script every, say, 300 seconds. You could then turn off notifications in the power manager, and just get notified when the power is less than x%.

#!/bin/bash
##
## battery

LOW_CHARGE=10

charge=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | awk '{print $2}')
charge=${charge%'%'*}

echo "Remaining battery = ${charge}%"
(( charge < ${LOW_CHARGE} )) && notify-send "Low charge!"

exit

You can also install acpi to get battery information.


How do i make conky run a script every 300 seconds?

Offline

#11 2020-01-06 22:20:10

ciko2283
Member
Registered: 2019-12-21
Posts: 17

Re: [SOLVED] Prolem with the power manager notifications on a laptop

Uooops wrote:

Maybe you should replace your battery with a new one. It seems it's going to die soon and that's why you have this problem

My baterry seems to be "stuck" in my laptop, the mechanism to take it out seems to be broken.
It should be really easy to take it out on thinkpads but i cant.
I tried pulling it as hard as i can but its jammed in there i think.

I dont know if thats causing the problem, i dont think so because it only happens when its full

Offline

#12 2020-01-06 22:47:11

rbh
Member
From: Sweden/Vasterbotten/Rusfors
Registered: 2016-08-11
Posts: 394

Re: [SOLVED] Prolem with the power manager notifications on a laptop

ciko2283 wrote:

My baterry seems to be "stuck" in my laptop, the mechanism to take it out seems to be broken.

You have read the manual and followed the desciption how to detach the batter?

It should be really easy to take it out on thinkpads but i cant.

If you a'int used to the modell, it sometimes can be a little tricky. Sometimes with two fingerns push the locker and simultaniosly press the battery out.

Last edited by rbh (2020-01-06 22:49:12)


// Regards rbh

Offline

#13 2020-01-06 23:07:02

damo
....moderator....
Registered: 2015-08-20
Posts: 5,970

Re: [SOLVED] Prolem with the power manager notifications on a laptop

ciko2283 wrote:

...
How do i make conky run a script every 300 seconds?

See man conky for what you can do with ${execi <command>}. You can also display battery status in conky with various conky variables.

Another option would be to run a script from your autostart, with an infinite loop:

#!/bin/bash
##
## battery.sh

LOW_CHARGE=10

while :
do
  charge=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | awk '{print $2}')
  charge=${charge%'%'*}
  (( charge < ${LOW_CHARGE} )) && notify-send "Low charge!"

  sleep 300
done
exit

And in autostart:

battery.sh &

Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#14 2020-01-07 01:11:43

cog
Cattle Baron
From: New Mexico, USA
Registered: 2015-10-27
Posts: 452
Website

Re: [SOLVED] Prolem with the power manager notifications on a laptop

@damo, thanks bud I might actually incorporate this into my setup to give it notifications.


Morning, Bunny.  Well, I can see you're in good health.  -George Washington McLintock! (John Wayne, AKA the Duke)

Offline

#15 2020-01-10 17:59:08

ciko2283
Member
Registered: 2019-12-21
Posts: 17

Re: [SOLVED] Prolem with the power manager notifications on a laptop

I think my battery was improperly inserted by the previous owner, it was really hard to remove but i somehow managed to pry it out with a screwdriver. The problem is gone now, notifications work fine.

Offline

#16 2020-01-10 18:24:27

damo
....moderator....
Registered: 2015-08-20
Posts: 5,970

Re: [SOLVED] Prolem with the power manager notifications on a laptop

If your issue is resolved, then please edit the title of your first post and add "[SOLVED]".

As a bonus, I now have a handy critical battery power notification, which is more noticeable than the default one smile


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#17 2020-01-10 21:42:01

ciko2283
Member
Registered: 2019-12-21
Posts: 17

Re: [SOLVED] Prolem with the power manager notifications on a laptop

damo wrote:

As a bonus, I now have a handy critical battery power notification, which is more noticeable than the default one smile

you can also get a package called "beep" and add && beep at the end of this line:

(( charge < ${LOW_CHARGE} )) && notify-send "Low charge!"

so it also beeps, so you know its empty even if you are not looking at your screen

Last edited by ciko2283 (2020-01-10 21:42:47)

Offline

#18 2020-01-10 21:49:01

damo
....moderator....
Registered: 2015-08-20
Posts: 5,970

Re: [SOLVED] Prolem with the power manager notifications on a laptop

Neat smile

You can also use speaker-test or aplay withoutout needing to install another package.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#19 2020-01-10 23:08:01

rbh
Member
From: Sweden/Vasterbotten/Rusfors
Registered: 2016-08-11
Posts: 394

Re: [SOLVED] Prolem with the power manager notifications on a laptop

I need to get audio-warning some % before suspending du to critical battery level. Had it before (quite a while ago), not sure when i disapeared or why..

The text abowe was for me not clear howto fix it ...


// Regards rbh

Offline

#20 2020-01-11 00:04:15

damo
....moderator....
Registered: 2015-08-20
Posts: 5,970

Re: [SOLVED] Prolem with the power manager notifications on a laptop

rbh wrote:

I need to get audio-warning some % before suspending du to critical battery level. Had it before (quite a while ago), not sure when i disapeared or why..

The text abowe was for me not clear howto fix it ...

This is the script I'm using, started in autostart. Change the sound command to suit, using eg aplay, mpv, beep etc (NB 'speaker-test' requires mono wav files)

#!/bin/bash
##
## battery.sh

LOW_CHARGE=10

while :
do
    charge=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | awk '{print $2}')
    charge=${charge%'%'*}
    msg="Low charge - ${charge}%!"
    
    if (( charge < ${LOW_CHARGE} ));then
        notify-send -u critical -i notification-battery-low \
            " " "<span color='#ff0000' font='26px'><i><b>${msg}</b></i></span>\n"
        amixer set -D pulse Master 50%  # in case mixer is muted
        speaker-test -l 1 -t wav -w "/path/to/alarm-clock.wav"    # loop once
    fi
    sleep 300
done

exit

Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

Board footer

Powered by FluxBB