No shutdown option for critically low battery [SOLVED]
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
- Pjotr
- Level 23
- Posts: 19888
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
No shutdown option for critically low battery [SOLVED]
In Cinnamon (17.2 Rafaela), I would like to set Power Manager to "shutdown" when the battery is critically low. However, I have no such option in its settings.
So I've tried using dconf and ploughed my way to org - cinnamon - settings-daemon - plugins - power.
There I set critical-battery-action to "shutdown". This doesn't register in the settings GUI for Power Manager, though.... It simply throws up a blank then, for the "critically low battery" setting.
What can I try next? Any thoughts, suggestions or inklings (however vague) are welcome.
So I've tried using dconf and ploughed my way to org - cinnamon - settings-daemon - plugins - power.
There I set critical-battery-action to "shutdown". This doesn't register in the settings GUI for Power Manager, though.... It simply throws up a blank then, for the "critically low battery" setting.
What can I try next? Any thoughts, suggestions or inklings (however vague) are welcome.
Last edited by Pjotr on Tue Aug 04, 2015 5:30 pm, edited 1 time in total.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Re: Power Manager: no shutdown option for critically low bat
Out of reasons discussed on another place I use 17.2 only in a VM, where this matter is not applicable. So I am not able to see, which options you have at all in the GUI. Do you please tell me?
A shot in the dark: On Github a found a confirmed bug (most likely regarding Cinnamon 2.4), which applied only on higher versions of the kernel. It is only a wild guess (but at now the only one which comes to my mind), but perhaps this is the case here? So: Do you use the the recommended kernel or another (newer) one?
A shot in the dark: On Github a found a confirmed bug (most likely regarding Cinnamon 2.4), which applied only on higher versions of the kernel. It is only a wild guess (but at now the only one which comes to my mind), but perhaps this is the case here? So: Do you use the the recommended kernel or another (newer) one?
- Pjotr
- Level 23
- Posts: 19888
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
Re: Power Manager: no shutdown option for critically low bat
This is a screenshot of the settings GUI, after I've used dconf-editor to set it to "shutdown" (click on the image to enlarge it):
The only other option except blank, is "Do nothing" (there also used to be the option "Hibernate", but I've disabled hibernation on that machine).
The kernel is the recommended one for Mint 17.2:
The GitHub bug report doesn't look related....
The only other option except blank, is "Do nothing" (there also used to be the option "Hibernate", but I've disabled hibernation on that machine).
The kernel is the recommended one for Mint 17.2:
Code: Select all
pjotr@Aspire-E3-111 ~ $ uname -r
3.16.0-38-generic
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Re: Power Manager: no shutdown option for critically low bat
I did not say, that it is related. My dark shot was, that this culprit could be also apply here.
- Pjotr
- Level 23
- Posts: 19888
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
Power Manager: no shutdown option for critically low battery
*bump*
Anyone else with ideas or inklings about this?
Anyone else with ideas or inklings about this?
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Re: Power Manager: no shutdown option for critically low bat
For some reasons the option to shutdown computer on battery critically low is missing.
Currently the code is
Command returns
The code should then read
Command should return
Currently the code is
Code: Select all
sed -n '/ \{4\}critical_options =/,+3p' /usr/lib/cinnamon-settings/modules/cs_power.py
A temporary fix to add shutdown option, use copy and paste to avoid a mistake.critical_options = [
("hibernate", _("Hibernate")),
("nothing", _("Do nothing"))
]
Code: Select all
sudo sed -i '/critical_options =/,+1 {s/("hibernate", _("Hibernate")),/&\n ("shutdown", _("Shutdown immediately")),/}' /usr/lib/cinnamon-settings/modules/cs_power.py
Code: Select all
sed -n '/ \{4\}critical_options =/,+4p' /usr/lib/cinnamon-settings/modules/cs_power.py
Try it, should work now.critical_options = [
("hibernate", _("Hibernate")),
("shutdown", _("Shutdown immediately")),
("nothing", _("Do nothing"))
]
- Pjotr
- Level 23
- Posts: 19888
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
Re: No shutdown option for critically low battery [SOLVED]
@Laurent85: merveilleux! Merci beaucoup.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Re: No shutdown option for critically low battery [SOLVED]
Same bug 17.3 and the above code doesn't work...
Re: No shutdown option for critically low battery [SOLVED]
Command allowing immediate shutdown option for LM 17.3:
Code: Select all
sudo sed -i '/critical_options =/,+1 {s/("hibernate", _("Hibernate")),/&\n ("shutdown", _("Shutdown immediately")),/}' /usr/share/cinnamon/cinnamon-settings/modules/cs_power.py
Re: No shutdown option for critically low battery [SOLVED]
Thanks Laurent85! Worked a treat.
Re: No shutdown option for critically low battery [SOLVED]
Sorry to 'revive' an old and solved topic, but I feel my point belongs here anyway.
To add "Ask what to do" to the list of possible options for when the battery is at critical level, can I simply edit cs_power.py adding
to critical_options so that it becomes
correct?
Will it simply suffice this edit (and of course to open the power options panel and set the desired entry)?
That would be wonderful, as I'm searching for a solution to both notify I didn't pay enough attention (!!!) and to leave me the option to either save and turn off, or to run for the charger... after all I should anyway have a few minutes left, right?
To add "Ask what to do" to the list of possible options for when the battery is at critical level, can I simply edit cs_power.py adding
Code: Select all
("interactive", _("Ask what to do")),
Code: Select all
critical_options = [
("hibernate", _("Hibernate")),
("interactive", _("Ask what to do")),
("nothing", _("Do nothing"))
]
Will it simply suffice this edit (and of course to open the power options panel and set the desired entry)?
That would be wonderful, as I'm searching for a solution to both notify I didn't pay enough attention (!!!) and to leave me the option to either save and turn off, or to run for the charger... after all I should anyway have a few minutes left, right?
Re: No shutdown option for critically low battery [SOLVED]
Please start a new thread. It'll get you more eyeballs too. Link to this one for reference, if you feel the need.
If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!