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
1 changed files with 9 additions and 5 deletions
14
neofetch
14
neofetch
|
@ -1505,14 +1505,18 @@ getdisk () {
|
|||
|
||||
# Add info bar
|
||||
disk_used=${disk_used/G}
|
||||
disk_used=${disk_used/T}
|
||||
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
|
||||
"bar") disk="$(bar "${disk_used/'.'}" "${disk_total/'.'}")" ;;
|
||||
"infobar") disk+=" $(bar "${disk_used/'.'}" "${disk_total/'.'}")" ;;
|
||||
"barinfo") disk="$(bar "${disk_used/'.'}" "${disk_total/'.'}") $disk" ;;
|
||||
"bar") disk="$(bar "${disk_used/'.'*}" "${disk_total/'.'*}")" ;;
|
||||
"infobar") disk+=" $(bar "${disk_used/'.'*}" "${disk_total/'.'*}")" ;;
|
||||
"barinfo") disk="$(bar "${disk_used/'.'*}" "${disk_total/'.'*}") $disk" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue