Disk: Split the output differently for macOS

This commit is contained in:
Dylan Araps 2016-12-16 23:47:08 +11:00
parent d738ad6f82
commit 157911547a

View file

@ -1543,9 +1543,20 @@ get_disk() {
disks=($(df -h /)) || { err "Disk: 'df' exited with error code 1"; return; } disks=($(df -h /)) || { err "Disk: 'df' exited with error code 1"; return; }
# Split the info # Split the info
disk_used="${disks[9]}" case "$os" in
disk_total="${disks[8]}" "Haiku") return ;;
disk_total_per="(${disks[11]})" "Mac OS X")
disk_used="${disks[10]}"
disk_total="${disks[9]}"
disk_total_per="(${disks[12]})"
;;
*)
disk_used="${disks[9]}"
disk_total="${disks[8]}"
disk_total_per="(${disks[11]})"
;;
esac
# Put it all together # Put it all together
disk="${disk_used} / ${disk_total} ${disk_total_per}" disk="${disk_used} / ${disk_total} ${disk_total_per}"