aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/get_battery_status12
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/get_battery_status b/bin/get_battery_status
index 5ad18ce..bc4b819 100755
--- a/bin/get_battery_status
+++ b/bin/get_battery_status
@@ -15,11 +15,13 @@ if [ -x /usr/bin/acpi ]; then
battery_percentage=$(echo $acpi_output|cut -d' ' -f4)
battery_percentage=${battery_percentage%","}
battery_percentage=${battery_percentage%"%"}
- if [ $battery_state = "Discharging" ]; then
- battery_remaining=$(echo $acpi_output|cut -d' ' -f5)
- echo "$battery_percentage% ($battery_remaining)"
- else
- echo "$battery_percentage%"
+ if [ $battery_number -ge 0 ]; then
+ if [ $battery_state = "Discharging" ]; then
+ battery_remaining=$(echo $acpi_output|cut -d' ' -f5)
+ echo "$battery_percentage% ($battery_remaining)"
+ else
+ echo "$battery_percentage%"
+ fi
fi
else
exit 1