You are not logged in.

#1 2017-05-02 07:58:01

re-mind
Member
From: Denmark
Registered: 2017-03-06
Posts: 43
Website

[solved] Power management while running out of battery

So I have this thinkpad x200s and when the battery runs out it dies.. hard. I would like it to hibernate instead. I have followed the wiki which tells me to add an udev rule.

/etc/udev/rules.d/99-lowbat.rules

# Suspend the system when battery level drops to 5% or lower
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="/usr/bin/systemctl hibernate"

It is now addet but I do not know if I need to do anything else. Do I need to activate it or add it to systemctl?

Thank you for reading my question smile

Last edited by re-mind (2017-05-07 21:06:30)


Mein.conf

Offline

#2 2017-05-02 12:19:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,891

Re: [solved] Power management while running out of battery

There's a link right below that instructions on the wiki page which tells you how to test rules before loading them.
Follow that and read the next ten lines...

Offline

#3 2017-05-07 21:03:48

re-mind
Member
From: Denmark
Registered: 2017-03-06
Posts: 43
Website

Re: [solved] Power management while running out of battery

Thank you for the answer seth smile

I'm just gonna write up the solution if anyone else needs the same answers. Setting the udev rule is "obviously" not enough. The udev-rule worked fine but Arch did not know where to write to and where to resume from. Therefore I edited the line in grub containing "GRUB_CMDLINE_LINUX_DEFAULT=" and replaced "quiet" with "resume=/dev/sda3" where sda3 is where my swap is located.

sudo nano /etc/default/grub 

Then edited /etc/mkinitcpio.conf and added "resume" under hooks AFTER udev.

sudo nano /etc/mkinitcpio.conf

Then rebuilt kernel and grub

mkinitcpio -p linux
grub-mkconfig -o /boot/grub/grub.cfg

Then it worked for me smile

Last edited by re-mind (2017-05-07 21:04:59)


Mein.conf

Offline

#4 2017-05-07 21:08:29

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,891

Re: [solved] Power management while running out of battery

That's a different problem and actually covered by https://wiki.archlinux.org/index.php/Po … ibernation :-P

Offline

#5 2017-05-08 07:26:49

re-mind
Member
From: Denmark
Registered: 2017-03-06
Posts: 43
Website

Re: [solved] Power management while running out of battery

seth wrote:

That's a different problem and actually covered by https://wiki.archlinux.org/index.php/Po … ibernation :-P

I had already read that page (and the page that it refers to about kernel parameters) but it did not tell me where to put in the kernel parameters (noob) so I had to go through a whole lot of digging and ended up with a combination of the three. Moreover the page about the udev here does not explain that I need to do the other steps smile


Mein.conf

Offline

Board footer

Powered by FluxBB