Progress bar support for battery usage

This commit is contained in:
Dylan 2016-03-03 11:09:40 +11:00
parent 5c374d28a2
commit e3dc2b9a38
4 changed files with 12 additions and 2 deletions

2
1.4.md
View File

@ -26,6 +26,8 @@ the output.
**Battery**<br \> **Battery**<br \>
- Added support for NetBSD - Added support for NetBSD
- Added `--battery_bar` and `$batter_bar` to enable/disable displaying a progress bar in<br \>
the output.
### Ascii ### Ascii

View File

@ -287,6 +287,7 @@ alias fetch2="fetch \
elapsed, total elapsed, total
--cpu_usage_bar on/off Whether or not to print a progress bar for cpu usage. --cpu_usage_bar on/off Whether or not to print a progress bar for cpu usage.
--memory_bar on/off Whether or not to print a progress bar for memory usage. --memory_bar on/off Whether or not to print a progress bar for memory usage.
--battery_bar on/off Whether or not to print a progress bar for battery usage.
Image: Image:

View File

@ -237,9 +237,10 @@ progress_color_total="8"
# Enable/Disable progress bars # Enable/Disable progress bars
# --cpu_usage_bar on/off # --cpu_usage_bar on/off
# --memory_bar on/off # --memory_bar on/off
# --battery_bar on/off
cpu_usage_bar="on" cpu_usage_bar="on"
memory_bar="on" memory_bar="on"
battery_bar="on"
# }}} # }}}

View File

@ -259,9 +259,10 @@ progress_color_total="8"
# Enable/Disable progress bars # Enable/Disable progress bars
# --cpu_usage_bar on/off # --cpu_usage_bar on/off
# --memory_bar on/off # --memory_bar on/off
# --battery_bar on/off
cpu_usage_bar="on" cpu_usage_bar="on"
memory_bar="on" memory_bar="on"
battery_bar="on"
# }}} # }}}
@ -1460,6 +1461,9 @@ getbattery () {
battery+="%" battery+="%"
;; ;;
esac esac
[ "$battery_bar" == "on" ] && \
battery+=" $(bar ${battery/'%'} 100)"
} }
# }}} # }}}
@ -2352,6 +2356,7 @@ usage () { cat << EOF
elapsed, total elapsed, total
--cpu_usage_bar on/off Whether or not to print a progress bar for cpu usage. --cpu_usage_bar on/off Whether or not to print a progress bar for cpu usage.
--memory_bar on/off Whether or not to print a progress bar for memory usage. --memory_bar on/off Whether or not to print a progress bar for memory usage.
--battery_bar on/off Whether or not to print a progress bar for battery usage.
Image: Image:
@ -2476,6 +2481,7 @@ while [ "$1" ]; do
;; ;;
--cpu_usage_bar) cpu_usage_bar="$2" ;; --cpu_usage_bar) cpu_usage_bar="$2" ;;
--memory_bar) memory_bar="$2" ;; --memory_bar) memory_bar="$2" ;;
--battery_bar) battery_bar="$2" ;;
# Image # Image
--image) --image)