Added disk support to progress bars

This commit is contained in:
Dylan 2016-03-03 11:52:39 +11:00
parent fe3e78d211
commit ae144ceee8
4 changed files with 18 additions and 1 deletions

6
1.4.md
View File

@ -26,7 +26,11 @@ 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 \> - Added `--battery_bar` and `$battery_bar` to enable/disable displaying a progress bar in<br \>
the output.
**Disk**:<br \>
- Added `--disk_bar` and `$disk_bar` to enable/disable displaying a progress bar in<br \>
the output. the output.
### Ascii ### Ascii

View File

@ -288,6 +288,7 @@ alias fetch2="fetch \
--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. --battery_bar on/off Whether or not to print a progress bar for battery usage.
--disk_bar on/off Whether or not to print a progress bar for disk usage.
Image: Image:

View File

@ -238,9 +238,11 @@ progress_color_total="8"
# --cpu_usage_bar on/off # --cpu_usage_bar on/off
# --memory_bar on/off # --memory_bar on/off
# --battery_bar on/off # --battery_bar on/off
# --disk_bar on/off
cpu_usage_bar="off" cpu_usage_bar="off"
memory_bar="off" memory_bar="off"
battery_bar="off" battery_bar="off"
disk_bar="off"
# }}} # }}}

View File

@ -260,9 +260,11 @@ progress_color_total="8"
# --cpu_usage_bar on/off # --cpu_usage_bar on/off
# --memory_bar on/off # --memory_bar on/off
# --battery_bar on/off # --battery_bar on/off
# --disk_bar on/off
cpu_usage_bar="off" cpu_usage_bar="off"
memory_bar="off" memory_bar="off"
battery_bar="off" battery_bar="off"
disk_bar="off"
# }}} # }}}
@ -1379,6 +1381,12 @@ getdisk () {
# Put it all together # Put it all together
disk="${disk_used} / ${disk_total} (${disk_total_per})" disk="${disk_used} / ${disk_total} (${disk_total_per})"
if [ "$disk_bar" == "on" ]; then
disk_used=${disk_used/T}
disk_total=${disk_total/T}
disk+=" $(bar "${disk_used/'.'}" "${disk_total/'.'}")"
fi
} }
# }}} # }}}
@ -2361,6 +2369,7 @@ usage () { cat << EOF
--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. --battery_bar on/off Whether or not to print a progress bar for battery usage.
--disk_bar on/off Whether or not to print a progress bar for disk usage.
Image: Image:
@ -2486,6 +2495,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" ;; --battery_bar) battery_bar="$2" ;;
--disk_bar) disk_bar="$2" ;;
# Image # Image
--image) --image)