You are not logged in.
Hello.
On a laptop, the power supply manager enables to set-up an action when the energy in the battery reaches a certain level. For example, at 20% we can choose to: do nothing, ask for action, go to sleep, shutdown the laptop.
My question is: is there a way to set-up a two levels scenario (with battery only, no external power supply plugged-in) ? I would like something like:
– at 20% ask me what to do,
– at 15% shutdown the laptop.
Sometimes, I have to quit my office and I am not in front of my laptop any more. The idea is: if I am here I can choose, if not the laptop shuts down a little bit latter to avoid 0% battery level.
Thank you for your help !
Offline
xfce4-power-manager can only handle one event/action, not two like you're asking for. But you could use udev to trigger one of the events.
For example, set up xfce4-power-manager to shutdown at 15%. Then create the following udev rule:
# Rule for when switching to battery
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="20", RUN+="/usr/bin/systemd-run --machine=toz@.host --user notify-send 'Battery Level Notification' 'Capacity reached'"
...make sure you change "toz" to your username.
Also make sure to reload udev rules:
sudo udevadm control --reload
Depending on the distro you are using, the udev rule could go into /etc/udev/rules.d.
At 20%, you should get a notification. At 15% the computer will shutdown.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 529.11 KiB (Peak: 531.81 KiB) ]