summaryrefslogtreecommitdiff
path: root/.a
diff options
context:
space:
mode:
Diffstat (limited to '.a')
-rwxr-xr-x.a/battery-status.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/.a/battery-status.sh b/.a/battery-status.sh
index 956330e..d446fcd 100755
--- a/.a/battery-status.sh
+++ b/.a/battery-status.sh
@@ -30,15 +30,15 @@ for bat in BAT0 BAT1; do
#
command -v notify-send >/dev/null 2>&1 || exit
- [ ! -e '/tmp/bat_notif' ] && touch /tmp/bat_notif
- bat_notif="$(cat /tmp/bat_notif)"
+ [ ! -e "/tmp/bat_notif$bat" ] && touch "/tmp/bat_notif$bat"
+ bat_notif="$(cat "/tmp/bat_notif$bat")"
# Notify when battery is charged to 80%
if [ $bat_state = 'c' ]; then
if [ "$bat_notif" != 80 ] && [ $bat_per -ge 80 ]; then
notify-send -u normal -i battery-charging -t 999999 "$bat at 80%"
- echo 80 > /tmp/bat_notif
+ echo 80 > "/tmp/bat_notif$bat"
fi
# Notify when battery discharges to 5%, 10%, 15% and 20%
@@ -48,7 +48,7 @@ for bat in BAT0 BAT1; do
break
elif [ $bat_per -le $per ]; then
notify-send -u critical -i battery-low -t 999999 "$bat at ${per}%"
- echo $per > /tmp/bat_notif
+ echo $per > "/tmp/bat_notif$bat"
break
fi
done
@@ -56,8 +56,8 @@ for bat in BAT0 BAT1; do
# Notify when battery is full
else
if [ "$bat_notif" != 100 ]; then
- notify-send -u normal -i battery-full -t 999999 'Fully charged!'
- echo 100 > /tmp/bat_notif
+ notify-send -u normal -i battery-full -t 999999 "$bat fully charged!"
+ echo 100 > "/tmp/bat_notif$bat"
fi
fi
done