update plugin documentation
diff --git a/plugins/available/battery.plugin.bash b/plugins/available/battery.plugin.bash
old mode 100644
new mode 100755
index 4b9d4b9..4c0e380
--- a/plugins/available/battery.plugin.bash
+++ b/plugins/available/battery.plugin.bash
@@ -1,11 +1,17 @@
#!/usr/bin/env bash
+cite about-plugin
+about-plugin query and display info about your battery charge level
+
battery_percentage(){
+ about 'displays battery charge as a percentage of full (100%)'
+ group battery
+
if command_exists acpi;
then
local ACPI_OUTPUT=$(acpi -b)
case $ACPI_OUTPUT in
- *" Unknown"*)
+ *" Unknown"*)
local PERC_OUTPUT=$(echo $ACPI_OUTPUT | head -c 22 | tail -c 2)
case $PERC_OUTPUT in
*%)
@@ -16,7 +22,7 @@
;;
esac
;;
- *" Discharging"*)
+ *" Discharging"*)
local PERC_OUTPUT=$(echo $ACPI_OUTPUT | head -c 26 | tail -c 2)
case $PERC_OUTPUT in
*%)
@@ -27,7 +33,7 @@
;;
esac
;;
- *" Charging"*)
+ *" Charging"*)
local PERC_OUTPUT=$(echo $ACPI_OUTPUT | head -c 23 | tail -c 2)
case $PERC_OUTPUT in
*%)
@@ -38,7 +44,7 @@
;;
esac
;;
- *" Full"*)
+ *" Full"*)
echo '99'
;;
*)
@@ -52,7 +58,7 @@
#local IOREG_OUTPUT_10_5=$(ioreg -l | grep -i capacity | grep -v Legacy| tr '\n' ' | ' | awk '{printf("%.2f%%", $14/$7 * 100)}')
local IOREG_OUTPUT=$(ioreg -n AppleSmartBattery -r | awk '$1~/Capacity/{c[$1]=$3} END{OFMT="%.2f%%"; max=c["\"MaxCapacity\""]; print (max>0? 100*c["\"CurrentCapacity\""]/max: "?")}')
case $IOREG_OUTPUT in
- 100*)
+ 100*)
echo '99'
;;
*)
@@ -65,6 +71,9 @@
}
battery_charge(){
+ about graphical display of your battery charge
+ group battery
+
# Full char
local F_C='▸'
# Depleted char