suspend on low battery

This really should hibernate rather than suspend, but hibernation
doesn't work on my system for some reason.

Partially addresses #18
This commit is contained in:
Pig Monkey 2016-01-28 19:34:46 -08:00
parent b8a827504f
commit f3d0466320
2 changed files with 4 additions and 0 deletions

View file

@ -0,0 +1 @@
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="/usr/bin/systemctl suspend"

View file

@ -4,3 +4,6 @@
- name: Copy logind configuration file
copy: src=logind.conf dest=/etc/systemd/logind.conf
- name: Push udev rule to suspend on low battery
copy: src=udev.rules dest=/etc/udev/rules.d/99-lowbat.rules