From 157911547a6177a85f174a3bd97b133770c53ff8 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 16 Dec 2016 23:47:08 +1100 Subject: [PATCH] Disk: Split the output differently for macOS --- neofetch | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 1c019f13..79c70b3e 100755 --- a/neofetch +++ b/neofetch @@ -1543,9 +1543,20 @@ get_disk() { disks=($(df -h /)) || { err "Disk: 'df' exited with error code 1"; return; } # Split the info - disk_used="${disks[9]}" - disk_total="${disks[8]}" - disk_total_per="(${disks[11]})" + 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_total="${disks[8]}" + disk_total_per="(${disks[11]})" + ;; + esac # Put it all together disk="${disk_used} / ${disk_total} ${disk_total_per}"