Explorar el Código

Write cron script to hibernate if notebook has low battery.

Drew hace 12 años
padre
commit
1152c4655f
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      scripts/auto-hibernate.sh

+ 6 - 0
scripts/auto-hibernate.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+batperc=$(cat /sys/class/power_supply/BAT0/uevent | grep CAPACITY | cut -f2 -d=)
+if [[ $batperc -eq "2" ]]; then
+  /usr/bin/systemctl hibernate
+fi