From af2cc27c307a56540f10acd939237e7c629ff193 Mon Sep 17 00:00:00 2001 From: z3rOR0ne Date: Fri, 17 Jun 2022 02:40:20 -0700 Subject: [PATCH] created simple battery notification script for laptop --- runit_scripts/batnotify/run | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 runit_scripts/batnotify/run diff --git a/runit_scripts/batnotify/run b/runit_scripts/batnotify/run new file mode 100755 index 00000000..5a0ffb41 --- /dev/null +++ b/runit_scripts/batnotify/run @@ -0,0 +1,11 @@ +#!/bin/bash + +while [ true ] ; do + PWRLVL=$(cat /sys/class/power_supply/BAT1/capacity) + if [ $PWRLVL -eq 15 ] ; then + exec notify-send "Battery is at 15%!!"; + break; + else + sleep 15s; + fi +done