Commit graph

27 commits

Author SHA1 Message Date
Kate Hsuan
4722fcfaac up-config: introduce the ExpectBatteryReCalibration for battery recalibration
ExpectBatteryReCalibration allows the user to ignore the
CriticalPowerAction when performing the battery recalibration.
2025-12-15 14:19:13 +08:00
Kate Hsuan
391e3323f0 etc: UPower.conf.d: add UPower.conf.d
The configuration files in the UPower.conf.d will override the primary
configuration.
2025-11-12 15:46:00 +08:00
Marcus B Spencer
83eecbab65 etc/UPower.conf: fix "riscky" typo
Fix the typo on line 86 where it says "riscky", when it should say
"risky"
2025-01-13 13:30:11 +08:00
Kate Hsuan
bab81e5e44 Fix spelling issues with codespell 2025-01-08 14:01:34 +08:00
Rogerio Alves
88031e563f Support fractional battery percent.
Make upower supports fractional battery percent
(e.g., 0.5% instead of 1%).

Signed-off-by: Rogerio Alves Cardoso <rogerio.cardoso@collabora.com>
2024-09-12 15:55:00 +08:00
Kate Hsuan
d756a7d512 up-config: A config and warning message for Ignore as the CriticalPowerAction
Action "Ignore" is one of the CriticalPowerAction. It is a risky action
so AllowRiskyCriticalPowerAction should be set to true to enable it.
2024-06-11 09:38:08 +00:00
Kate Hsuan
69436647c5 linux: up-backend: A safeguard for the risky CriticalPowerAction
If AllowRiskyCriticalPowerAction is true and the CriticalPowerAction
is "Suspend", The "Suspend" can be the CriticalPowerAction.
Otherwise, "HybridSleep" will be the CriticalPowerAction.
2024-04-25 16:07:11 +08:00
Kate Hsuan
8cb9fb0231 up-config: The warning message for the risky CriticalPowerAction
The warning message will be shown when CriticalPowerAction is "Suspend".
One iwarning message is for enabling the risky CriticalPowerAction and
the other is to show the potential risk when
AllowRiskyCriticalPowerAction is true.
2024-04-25 16:07:11 +08:00
Alexander Couzens
18b4748435 linux: allow Suspend as CriticalPowerAction
When using UPower in a non-hybernate setup, the result of a
CriticalPowerAction would be PowerOff. Certain users prefer
Suspend instead, because this is the only way to recover
graceful from that state.
Suspend action will only used, when explicit configured.

Closes: #23
Closes: #59
Signed-off-by: Kate Hsuan <hpa@redhat.com>
2024-04-25 16:07:11 +08:00
pacien
c4cf2e579c etc: Document Time* unit 2021-09-07 09:27:20 +00:00
Bastien Nocera
9b93b6c402 build: Remove autotools 2021-09-06 14:06:40 +02:00
Benjamin Berg
f2e702d4dc build: Support building upower with meson 2021-09-02 17:47:30 +02:00
Bastien Nocera
a14de39241 etc: Tweak default percentage levels
If we want the computer to be able to take useful action about the low
battery, we should have a slightly higher "low" percentage level so that
power saving made really makes a difference in runtime.

Also bump "critical" slightly so that doom isn't quite as near but in the
distance nonetheless.

The "action" level stays the same, as 1% is too close to some batteries'
actual switch off point, eg. the computer might brown out before we see
1%.
2021-07-22 12:36:55 +02:00
Bastien Nocera
28bd86c181 etc: Update IgnoreLid documentation
It's not used by gnome-settings-daemon any more, logind reads the
Lid status itself.

https://bugs.freedesktop.org/show_bug.cgi?id=92920
2015-11-12 16:38:42 +01:00
Bastien Nocera
db4f9b43df etc: Change the default low battery policy
It is now based on the percentage of battery left, rather than the
usually unreliable "time left". See configuration file for more details.

https://bugs.freedesktop.org/show_bug.cgi?id=92920
2015-11-12 16:37:37 +01:00
Bastien Nocera
135339acc1 daemon: Deprecate "IsDocked" property
The IsDocked property has been incorrect for a number of laptops for a
while, as it thought that laptops with hybrid graphics cards were always
docked.

The alternative would have been to use the platform/dock_station
devices, but those are only exported for ACPI docking stations.

Instead, whether an external display is attached (which isn't really
docking) should be checked in the same place where the policy depending
on the value should be applied, such as gnome-settings-daemon.

https://bugs.freedesktop.org/show_bug.cgi?id=36818
2014-05-07 09:27:24 +02:00
Bastien Nocera
4d0af3b31b linux: Add NoPollBatteries configuration option
For system integrators. If your firmware is helpful to user space
and automatically sends out uevent when the battery level changes
(rather than just the battery state) as on most machines,
you can enable "NoPollBatteries" in the configuration option,
and reduce power consumption from UPower and its listeners.
2013-10-26 14:55:15 +02:00
Bastien Nocera
68b9975ad9 daemon: Add CriticalPowerAction
Paraphrasing from the configuration option:
The action to take when "TimeAction" or "PercentageAction" above has
been reached for the batteries (UPS or laptop batteries) supplying
the computer.

This is done 20 seconds after the warning-level variable got set
to UP_DEVICE_LEVEL_ACTION has been set, to give the opportunity
to front-ends to display a (short) warning.

This is only implemented for the Linux backend, using logind.
2013-10-14 11:06:53 +02:00
Bastien Nocera
4a5d12a909 etc: Add configuration for battery levels 2013-10-14 10:42:56 +02:00
Bastien Nocera
e981026d99 etc: Remove now unused configuration options 2013-10-14 10:42:55 +02:00
Bastien Nocera
d6bfaaf0aa etc: Disable Watts-Up devices by default
They are few are far between, and users of the device can
spare the time to enable this by default.

https://bugs.freedesktop.org/show_bug.cgi?id=33846
2013-10-14 10:18:18 +02:00
Landry Breuil
19790b99a2 Add boolean RunPowersaveCommand to UPower.conf
Defaulting to true, it controls whether we want the powersave commands
to be run when running on battery/plugging ac.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-01-06 16:40:09 +00:00
Richard Hughes
b19fca9637 Use git.mk and remove the manual .gitignore files 2011-07-19 12:40:21 +01:00
Richard Hughes
c98ca6f8f5 Add a config option 'IgnoreLid' so users with broken / inverted lid switches don't suspend at session start 2011-03-28 16:41:02 +01:00
Richard Hughes
b0bbb29df1 Add a config option 'EnableWattsUpPro' to disable the Watts Up Pro device
Annoyingly, the device used in the Watts Up Pro device seems to be a generic
USB->serial adaptor, which means it doesn't have a unique vendor and product
ID. If we try to probe for the WUP device, we can actually upset other devices
that are not expecing to be probed. This fixes #33846 although we actually
still need to be more strict in detecting a true WUP device.
2011-03-14 11:01:12 +00:00
Richard Hughes
38199e44ff Add an option for polling dock devices in UPower.conf, defaulting to false 2011-03-03 14:02:27 +00:00
Richard Hughes
5f1e64709b Add a config file with SleepTimeout and AllowHibernateEncryptedSwap entries 2010-04-14 10:08:57 +01:00