From 868d8c2d8e85bb316e97d6904a4c3b8e9ae6ee31 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 17 Dec 2016 00:03:58 +1100 Subject: [PATCH] Disk: [macOS] Use -P --- neofetch | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/neofetch b/neofetch index a5a64400..1c89a8ab 100755 --- a/neofetch +++ b/neofetch @@ -1539,20 +1539,20 @@ get_term_font() { get_disk() { type -p df >/dev/null 2>&1 || { err "Disk requires 'df' to function. Install 'df' to get disk info."; return; } - # Get the info for / - disks=($(df -h /)) || { err "Disk: 'df' exited with error code 1"; return; } - # Split the info case "$os" in "Haiku") return ;; - "Mac OS X") ;; - *) - disk_used="${disks[9]}" - disk_total="${disks[8]}" - disk_total_per="(${disks[11]})" - ;; + "Mac OS X") df_flags=(-P -h /) ;; + *) df_flags=(-h /) ;; esac + # Get the info for / + disks=($(df "${df_flags[@]}")) || { err "Disk: 'df' exited with error code 1"; return; } + + disk_used="${disks[9]}" + disk_total="${disks[8]}" + disk_total_per="(${disks[11]})" + # Put it all together disk="${disk_used} / ${disk_total} ${disk_total_per}"