summaryrefslogtreecommitdiff
path: root/battery-status.sh
diff options
context:
space:
mode:
Diffstat (limited to 'battery-status.sh')
-rwxr-xr-xbattery-status.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/battery-status.sh b/battery-status.sh
index 990036e..efbc2a2 100755
--- a/battery-status.sh
+++ b/battery-status.sh
@@ -1,5 +1,9 @@
#!/bin/bash
+if [[ "$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep native-path | awk '{print $2}')" == '(null)' ]]; then
+ exit
+fi
+
battery_notify () {
# if battery percentage is equal to given one, if battery percentage inside /tmp/battery.tmp is not equal to given one and if power indicator is the given on
if [ ${__bat_per} -eq $1 ] && ! grep -q $1 "/tmp/battery.tmp" && [[ ${__bat_power} = $2 ]]; then