made disk_bar easier to use

This commit is contained in:
Andrew Titmuss 2016-03-12 23:43:16 +11:00
parent 8cce81c47e
commit 78e78a08f2
1 changed files with 15 additions and 10 deletions

View File

@ -1438,17 +1438,22 @@ 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 # Add info bar
case "$disk_info_bar" in
"bar" | "infobar" | "barinfo")
disk_used=${disk_used/G} disk_used=${disk_used/G}
disk_used=${disk_used/T} disk_used=${disk_used/T}
disk_total=${disk_total/G} disk_total=${disk_total/G}
disk_total=${disk_total/T} disk_total=${disk_total/T}
case "$disk_info" in case "$disk_info_bar" in
"off") disk="$(bar "${disk_used/'.'}" "${disk_total/'.'}")" ;; "bar") disk="$(bar "${disk_used/'.'}" "${disk_total/'.'}")" ;;
*) disk+=" $(bar "${disk_used/'.'}" "${disk_total/'.'}")" ;; "infobar") disk+=" $(bar "${disk_used/'.'}" "${disk_total/'.'}")" ;;
"barinfo") disk="$(bar "${disk_used/'.'}" "${disk_total/'.'}") $disk" ;;
esac
;;
esac esac
fi
} }
# }}} # }}}