From 83954961af8b6337da100e038561f2fd975ac1fe Mon Sep 17 00:00:00 2001 From: filip <“filip.rabiega@gmail.com”> Date: Sun, 18 Jan 2026 11:44:26 +0100 Subject: huge changes --- batterylow | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 batterylow (limited to 'batterylow') diff --git a/batterylow b/batterylow new file mode 100755 index 0000000..cf081d1 --- /dev/null +++ b/batterylow @@ -0,0 +1,14 @@ +#!/bin/sh + +# those variables may be unnecessary +export DISPLAY=:0 +export HOME=/home/filipek + +percentage=$(upower -i "$(upower -e | grep BAT)" | + awk '/percentage/ {gsub(/%/, "", $2); print $2}') + +if [ "$percentage" -le 5 ]; then + notify-send "Battery very low." +elif [ "$percentage" -ge 14 ] && [ "$percentage" -le 15 ]; then + notify-send "Battery low." +fi -- cgit v1.2.3