How to Change Battery Critical Low Action in Ubuntu 22.04 [Updated]

Last updated: March 17, 2023

Ubuntu will by default go sleep when your laptop battery is running into critical low. For those who want to apply anther action, here’s how to do the trick in Ubuntu with the default GNOME desktop.

NOTE: This tutorial is tested and works in Ubuntu 22.04 with default GNOME. It may also works in current other Ubuntu releases.

1. First, open terminal either by searching from ‘Activities’ overview or by pressing Ctrl+Alt+T on keyboard.

2. When terminal opens, run command to edit the upower config file:

sudo gedit /etc/UPower/UPower.conf

For Ubuntu 22.10+, replace gedit in command with gnome-text-editor, or use nano instead for other Linux.

3. Once file opens, scroll down and find out the line CriticalPowerAction=HybridSleep (the last line in my case). As the description says, you can change the value into:

(Optional) 4. For choice, you may also edit the value of following lines:

  • PercentageLow=20 – battery low when percentage 20% left.
  • PercentageCritical=5 – battery critical when percentage 5% left.
  • PercentageAction=2 – perform the action you set in step 3 when battery 2% left.

In case you want to use time remaining instead, find out and change UsePercentageForPolicy=false. So, following values will be in active:

  • TimeLow=1200 – battery low when 1200 seconds left.
  • TimeCritical=300 – battery critical when 300 seconds left.
  • TimeAction=120 – perform action (step 3) when 120 seconds left.

5. Once you saved the file (for nano text editor, press Ctrl+X, type y and hit Enter), run the command to restart upower service to apply changes:

sudo systemctl restart upower.service

That’s all. Enjoy!

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1 |

4 responses to How to Change Battery Critical Low Action in Ubuntu 22.04 [Updated]

  1. DOESN’T WORK

  2. LM 19.2 – Cinnamon – it doesn’t work !

  3. Aidamir Lovpache November 19, 2019 at 7:38 pm

    DOESN’T WORK!

  4. DOESN’T WORK! please