From c1b320de32063c5b7e13effa114128c9deffbe54 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 6 Jan 2017 21:23:51 +1100 Subject: [PATCH] Disk: Use -h for all OS but Haiku --- neofetch | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/neofetch b/neofetch index 9de18241..cef5b50f 100755 --- a/neofetch +++ b/neofetch @@ -1614,17 +1614,11 @@ 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 "df" flags. - case "$os" in - "Haiku") err "Disk doesn't work on Haiku due to the non-standard 'df'"; return ;; - "Mac OS X") df_flags=(-P -h) ;; - *) df_flags=(-h) ;; - esac + [[ "$os" == "Haiku" ]] && { err "Disk doesn't work on Haiku due to the non-standard 'df'"; return; } # Create an array called 'disks' where each element is a separate line from # df's output. We then unset the first element which removes the column titles. - readarray disks < <(df "${df_flags[@]}" "${disk_show[@]:-/}") && unset 'disks[0]' + readarray disks < <(df -h "${disk_show[@]:-/}") && unset 'disks[0]' # Stop here if 'df' fails to print disk info. [[ -z "${disks[@]}" ]] && \