
If you have more than one battery or if you are using a battery powered peripheral device, the rule could be triggered unexpectedly by another battery discharging this can be fixed by obtaining another attribute/value pair to add to your udev rule that specifically match the main battery, for example model_name. Some laptops do not boot beyond a certain battery level, so the rule could be adjusted accordingly. As such, when resuming from hibernate when the battery is critical, the computer will hibernate directly. This rule will be repeated whenever the condition is set. For instance, /usr/bin/systemctl hibernate may return the error: "Call to Hibernate failed: Not enough swap space for hibernation" Test the command to be run beforehand to make sure it would work.See here for available pattern matching with udev rules. It does not mean "when capacity is in the range from 0 to 5", and using something like will not match a capacity in the range 20 to 25.
In the example, is a shell-like pattern matching expression that matches one character in the range 0 to 5. If your battery sends events to udev whenever it (dis)charges by 1%, you can use this udev rule to automatically hibernate the system when battery level is critical, and thus prevent all unsaved work from being lost. batsignal AUR is a lightweight battery monitor daemon that uses libnotify to warn of low battery levels. batify AUR is an udevrule file triggering plug and battery level notifications (multi-x sessions support). cbatticon is a battery icon that sits in the system tray. ACPI command line utilities are provided via the acpi package. On some systems, the battery sends events to udev whenever it (dis)charges by 1%, this event can be connected to some action using a udev rule.īattery state can be read using ACPI utilities from the terminal. Classical method is some daemon periodically polling battery level using ACPI interface. Reading battery state can be done in multiple ways. The following tools and programs help to increase battery life and keep your laptop cool and quiet. Power management is very important for anyone who wishes to make good use of their battery capacity. Additional laptop-specific features are described below.
Note: You should read the articles Power management and CPU frequency scaling.