Merge pull request #146 from iandrewt/disk_display_fix
fixed output of disk bar when gigabytes are used of a terabyte disk
This commit is contained in:
commit
f17220c04a
14
neofetch
14
neofetch
|
@ -1505,14 +1505,18 @@ getdisk () {
|
||||||
|
|
||||||
# Add info bar
|
# Add info bar
|
||||||
disk_used=${disk_used/G}
|
disk_used=${disk_used/G}
|
||||||
disk_used=${disk_used/T}
|
|
||||||
disk_total=${disk_total/G}
|
disk_total=${disk_total/G}
|
||||||
disk_total=${disk_total/T}
|
|
||||||
|
[[ "$disk_used" == *"T" ]] && \
|
||||||
|
disk_used=$(printf "%s\n" "${disk_used/T} * 1000" | bc)
|
||||||
|
|
||||||
|
[[ "$disk_total" == *"T" ]] && \
|
||||||
|
disk_total=$(printf "%s\n" "${disk_total/T} * 1000" | bc)
|
||||||
|
|
||||||
case "$disk_display" in
|
case "$disk_display" in
|
||||||
"bar") disk="$(bar "${disk_used/'.'}" "${disk_total/'.'}")" ;;
|
"bar") disk="$(bar "${disk_used/'.'*}" "${disk_total/'.'*}")" ;;
|
||||||
"infobar") disk+=" $(bar "${disk_used/'.'}" "${disk_total/'.'}")" ;;
|
"infobar") disk+=" $(bar "${disk_used/'.'*}" "${disk_total/'.'*}")" ;;
|
||||||
"barinfo") disk="$(bar "${disk_used/'.'}" "${disk_total/'.'}") $disk" ;;
|
"barinfo") disk="$(bar "${disk_used/'.'*}" "${disk_total/'.'*}") $disk" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue