From b712c88e40891d801a577a269baa6c28c4cd1c4c Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 9 Aug 2021 22:27:31 +0300 Subject: feat: add notify_low_battery script --- env/.local/bin/notify_low_battery.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 env/.local/bin/notify_low_battery.sh (limited to 'env/.local/bin/notify_low_battery.sh') diff --git a/env/.local/bin/notify_low_battery.sh b/env/.local/bin/notify_low_battery.sh new file mode 100755 index 0000000..e0e6f84 --- /dev/null +++ b/env/.local/bin/notify_low_battery.sh @@ -0,0 +1,4 @@ +#!/bin/sh +CAPACITY=$(cat /sys/class/power_supply/BAT0/capacity) +[ $CAPACITY -lt 20 ] && notify-send --urgency=critical "Low battery" "Less then $CAPACITY% remaining.\n Charge your laptop." + -- cgit v1.2.3