Skip to content

Instantly share code, notes, and snippets.

@gngdb
Created April 4, 2014 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gngdb/9977911 to your computer and use it in GitHub Desktop.
Save gngdb/9977911 to your computer and use it in GitHub Desktop.
## 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
Copy link
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