diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2019-11-23 16:16:30 -0500 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2019-11-23 16:16:30 -0500 |
| commit | a5e66ac4f45322b3665c944ba34d83b7db43ebc5 (patch) | |
| tree | bed315d0a7f2c180b3eb634ece3a6a2089cdeb6f /.local/bin/cron/cronbat | |
| parent | 85d353d7963391cd66f23a3e99a66b8b58045e4c (diff) | |
| download | eibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.tar.gz eibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.tar.zst eibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.zip | |
merger of bin
Diffstat (limited to '.local/bin/cron/cronbat')
| -rwxr-xr-x | .local/bin/cron/cronbat | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/.local/bin/cron/cronbat b/.local/bin/cron/cronbat new file mode 100755 index 0000000..ee21a17 --- /dev/null +++ b/.local/bin/cron/cronbat @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +# Notify me with notify-send if my battery is below 25%. +# You can set this to run via cron. + +[ "$(cat /sys/class/power_supply/BAT0/status)" = "Charging" ] && exit +[ "$(cat /sys/class/power_supply/BAT0/capacity)" -lt 25 ] && +export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus && +notify-send -u critical "Battery critically low." |
