{"id":9199,"date":"2019-07-23T15:48:42","date_gmt":"2019-07-23T15:48:42","guid":{"rendered":"http:\/\/ubuntuhandbook.org\/?p=9199"},"modified":"2023-03-17T15:09:56","modified_gmt":"2023-03-17T15:09:56","slug":"change-battery-critical-low-action-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2019\/07\/change-battery-critical-low-action-ubuntu-18-04\/","title":{"rendered":"How to Change Battery Critical Low Action in Ubuntu 22.04 [Updated]"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/10\/gnome-logo-feature.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-34682\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/10\/gnome-logo-feature-250x250.png\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/10\/gnome-logo-feature-250x250.png 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/10\/gnome-logo-feature-300x300.png 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/10\/gnome-logo-feature-600x600.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/10\/gnome-logo-feature-768x768.png 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/10\/gnome-logo-feature.png 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>Ubuntu will by default go sleep when your laptop battery is running into critical low. For those who want to apply anther action, here&#8217;s how to do the trick in Ubuntu with the default GNOME desktop.<\/p>\n<p><b>NOTE: This tutorial is tested and works in Ubuntu 22.04 with default GNOME. It may also works in current other Ubuntu releases.<\/b><\/p>\n<p>1. First, open terminal either by searching from &#8216;Activities&#8217; overview or by pressing <b>Ctrl+Alt+T<\/b> on keyboard.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/terminal-jammy.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-38555\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/terminal-jammy.png\" alt=\"\" width=\"522\" height=\"299\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/terminal-jammy.png 522w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/terminal-jammy-300x172.png 300w\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" \/><\/a><\/p>\n<p>2. When terminal opens, run command to edit the upower config file:<\/p>\n<pre>sudo gedit \/etc\/UPower\/UPower.conf<\/pre>\n<p>For Ubuntu 22.10+, replace <code>gedit<\/code> in command with <code>gnome-text-editor<\/code>, or use <code>nano<\/code> instead for other Linux.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/07\/edit-upower.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-43790\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/07\/edit-upower-600x148.webp\" alt=\"\" width=\"600\" height=\"148\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/07\/edit-upower-600x148.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/07\/edit-upower-300x74.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/07\/edit-upower-768x190.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/07\/edit-upower.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>3. Once file opens, scroll down and find out the line <b>CriticalPowerAction=HybridSleep<\/b> (the last line in my case). As the description says, you can change the value into:<\/p>\n<ul>\n<li><b>PowerOff<\/b><\/li>\n<li><b>Hibernate<\/b> &#8211; need to enable <a href=\"https:\/\/ubuntuhandbook.org\/index.php\/2021\/08\/enable-hibernate-ubuntu-21-10\/\">hibernate function<\/a> first.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/07\/config-upoweraction.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-43791\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/07\/config-upoweraction-600x430.webp\" alt=\"\" width=\"600\" height=\"430\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/07\/config-upoweraction-600x430.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/07\/config-upoweraction-300x215.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/07\/config-upoweraction-768x550.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/07\/config-upoweraction.webp 864w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>(Optional) 4. For choice, you may also edit the value of following lines:<\/p>\n<ul>\n<li><b>PercentageLow=20<\/b> &#8211; battery low when percentage 20% left.<\/li>\n<li><b>PercentageCritical=5<\/b> &#8211; battery critical when percentage 5% left.<\/li>\n<li><b>PercentageAction=2<\/b> &#8211; perform the action you set in step 3 when battery 2% left.<\/li>\n<\/ul>\n<p>In case you want to use time remaining instead, find out and change <b>UsePercentageForPolicy=false<\/b>. So, following values will be in active:<\/p>\n<ul>\n<li><b>TimeLow=1200<\/b> &#8211; battery low when 1200 seconds left.<\/li>\n<li><b>TimeCritical=300<\/b> &#8211; battery critical when 300 seconds left.<\/li>\n<li><b>TimeAction=120<\/b> &#8211; perform action (step 3) when 120 seconds left.<\/li>\n<\/ul>\n<p>5. Once you saved the file (for <code>nano<\/code> text editor, press <b>Ctrl+X<\/b>, type <b>y<\/b> and hit Enter), run the command to restart upower service to apply changes:<\/p>\n<pre>sudo systemctl restart upower.service<\/pre>\n<p>That&#8217;s all. Enjoy!<\/p>","protected":false},"excerpt":{"rendered":"<p>Ubuntu will by default go sleep when your laptop battery is running into critical low. For those who want to apply anther action, here&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":34682,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1768],"class_list":["post-9199","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-critical-low-battery-action"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/9199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=9199"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/9199\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/34682"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=9199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=9199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=9199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}