Skip to content

Instantly share code, notes, and snippets.

@gngdb gngdb/gist:9977911
Created Apr 4, 2014

Embed
What would you like to do?
## Hibernating
Want to hibernate at low battery automatically. First getting hibernate to work. Created swap partition larger than RAM (8Gb) and set it up with mkswap and swapon as in [Arch Wiki](https://wiki.archlinux.org/index.php/Swap). Added kernel parameters to grub. **Problem**: didn't read the article properly and forgot to add to fstab so swap didn't stay on reboot.
Next should use udev rule to get the system to auto-hiberate at 5% or similar. [Forum post](https://bbs.archlinux.org/viewtopic.php?pid=1164408) appears to cover how to do this, but doesn't. It's in the [Laptop page](https://wiki.archlinux.org/index.php/laptop#Udev_events) of the arch wiki.
```
# Suspend the system when battery level drops to 2%
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="2", RUN+="/usr/bin/systemctl suspend"
```
Modified the above to this:
```
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="2", RUN+="/usr/bin/systemctl hibernate"
```
However, does not appear to be working yet. Could be a problem with detecting battery state. i3status can detect it so it might be possible to fix this by looking at that.
@gngdb

This comment has been minimized.

Copy link
Owner Author

gngdb commented Apr 4, 2014

exercept from laptop setup notebook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.