aboutsummaryrefslogtreecommitdiffstats
path: root/.config/herbstluftwm/notify.sh
diff options
context:
space:
mode:
Diffstat (limited to '.config/herbstluftwm/notify.sh')
-rwxr-xr-x.config/herbstluftwm/notify.sh30
1 files changed, 0 insertions, 30 deletions
diff --git a/.config/herbstluftwm/notify.sh b/.config/herbstluftwm/notify.sh
deleted file mode 100755
index 190d496..0000000
--- a/.config/herbstluftwm/notify.sh
+++ /dev/null
@@ -1,30 +0,0 @@
1#!/bin/bash
2
3monitor_w=$1
4window_p=$2
5panel_h=$3
6
7popup_w=$(echo "$monitor_w - (2 * $window_p)" | bc)
8popup_h=$panel_h
9popup_x=$window_p
10popup_y=$window_p
11
12popup_opts="-w $popup_w -h $popup_h -x $popup_x -y $popup_y"
13
14while true; do
15
16 bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity)
17 bat_stat=$(cat /sys/class/power_supply/BAT1/status)
18
19 if [[ $bat_lvl -le 5 && $bat_stat == "Discharging" ]]; then
20 $4 -m "Battery level critical: $bat_lvl%%" -u "high" $popup_opts
21 elif [[ $bat_lvl -eq 10 && $bat_stat == "Discharging" ]]; then
22 $4 -m "Battery level low: $bat_lvl%%" $popup_opts
23 elif [[ $bat_lvl -eq 50 && $bat_stat == "Discharging" ]]; then
24 $4 -m "Battery level at $bat_lvl%%" $popup_opts
25 elif [[ $bat_lvl -eq 100 && $bat_stat == "Charging" ]]; then
26 $4 -m "Battery fully charged"
27 fi
28
29 sleep 60;
30done