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

View file

@ -1438,17 +1438,22 @@ getdisk () {
# Put it all together
disk="${disk_used} / ${disk_total} (${disk_total_per})"
if [ "$disk_bar" == "on" ]; then
disk_used=${disk_used/G}
disk_used=${disk_used/T}
disk_total=${disk_total/G}
disk_total=${disk_total/T}
# Add info bar
case "$disk_info_bar" in
"bar" | "infobar" | "barinfo")
disk_used=${disk_used/G}
disk_used=${disk_used/T}
disk_total=${disk_total/G}
disk_total=${disk_total/T}
case "$disk_info" in
"off") disk="$(bar "${disk_used/'.'}" "${disk_total/'.'}")" ;;
*) disk+=" $(bar "${disk_used/'.'}" "${disk_total/'.'}")" ;;
esac
fi
case "$disk_info_bar" in
"bar") disk="$(bar "${disk_used/'.'}" "${disk_total/'.'}")" ;;
"infobar") disk+=" $(bar "${disk_used/'.'}" "${disk_total/'.'}")" ;;
"barinfo") disk="$(bar "${disk_used/'.'}" "${disk_total/'.'}") $disk" ;;
esac
;;
esac
}
# }}}