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
1 changed files with 14 additions and 3 deletions

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
case "$os" in
"Haiku") return ;;
"Mac OS X")
disk_used="${disks[10]}"
disk_total="${disks[9]}"
disk_total_per="(${disks[12]})"
;;
*)
disk_used="${disks[9]}" disk_used="${disks[9]}"
disk_total="${disks[8]}" disk_total="${disks[8]}"
disk_total_per="(${disks[11]})" 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}"