Commit e3dc2b9a authored by Dylan's avatar Dylan

Progress bar support for battery usage

parent 5c374d28
...@@ -26,6 +26,8 @@ the output. ...@@ -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
......
...@@ -287,6 +287,7 @@ alias fetch2="fetch \ ...@@ -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:
......
...@@ -237,9 +237,10 @@ progress_color_total="8" ...@@ -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"
# }}} # }}}
......
...@@ -259,9 +259,10 @@ progress_color_total="8" ...@@ -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 () { ...@@ -1460,6 +1461,9 @@ getbattery () {
battery+="%" battery+="%"
;; ;;
esac esac
[ "$battery_bar" == "on" ] && \
battery+=" $(bar ${battery/'%'} 100)"
} }
# }}} # }}}
...@@ -2352,6 +2356,7 @@ usage () { cat << EOF ...@@ -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 ...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment