Xfce Forum

Sub domains
 

You are not logged in.

#1 2025-02-21 21:37:59

kwizzz
Member
Registered: 2024-11-10
Posts: 22
LinuxFirefox 128.0

How to get critical battery warning *before* critical power action?

Power Manager provides nice notifications when battery is draining (and charging).
So, there is a message that power level is low (which happens way too early, btw), but there is no such a message that the level is critical and system is going to suspend or hibernate or whatever you chose in the Power Manager settings.

How can I get a notification before suspend so that I can run and find an AC adapter?

Maybe I can adjust the low battery warning to something close to critical power level (like +2%)?  How would this be done, if possible?
Another approach would be to install battery monitor, but then it's like having two battery tools running...

Offline

#2 2025-02-22 14:49:54

k3dAR
Member
From: Czech Republic
Registered: 2022-07-27
Posts: 109
LinuxChrome 134.0

Re: How to get critical battery warning *before* critical power action?

Not sure who/what show notification about Low level, but in /etc/UPower/UPower.conf is (cuted only relevant lines):

[UPower]
UsePercentageForPolicy=true

# When UsePercentageForPolicy is true, the levels at which UPower will
# consider the battery low, critical, or take action for the critical
# battery level.
#
PercentageLow=20
PercentageCritical=5
PercentageAction=2

# The action to take when "TimeAction" or "PercentageAction" above has been
# reached for the batteries (UPS or laptop batteries) supplying the computer
#
# Possible values are:
# PowerOff
# Hibernate
# HybridSleep
#
# If HybridSleep isn't available, Hibernate will be used
# If Hibernate isn't available, PowerOff will be used
CriticalPowerAction=HybridSleep

and in PowerManager right of Critical level setting is exclamation mark yellow icon with:

"Make sure you set a sufficiently high value here, otherwise the system will
trigger its own action before xfce4-power-manager, without being able to
prevent it or know exactly when it will do so. The action triggered by the
system in this case will be: HybridSleep."

If in UPower.conf i change CriticalPowerAction to Hibernate (and: systemctrl restart upower), then above message (after close/reopen window) show "...wille be: Hibernate", so maybe PercentageLow from UPower.conf is also used?

Last edited by k3dAR (2025-02-22 14:51:23)

Offline

#3 2025-02-22 18:51:56

kwizzz
Member
Registered: 2024-11-10
Posts: 22
LinuxFirefox 128.0

Re: How to get critical battery warning *before* critical power action?

Oh, nice.  I will experiment a bit.  First, I set

CriticalPowerAction=HybridSleep

as I prefer this.  If I understand upower correctly, it will kick in independently of Power Manager.  So I set the critical power level a bit higher than upower's and as an action I use 'Ask'.  If things go as I want them, then I would get a real strong warning with option to act from Power Manager and if I don't react (being away from the system), then it will enter hybrid sleep after a few more minutes.

Let's see :-)

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 527.76 KiB (Peak: 528.67 KiB) ]