From 2942abd46bb5637e59e7c3a8522b59cac361aa84 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 19 Dec 2016 12:07:20 +1100 Subject: [PATCH] Disk: Fix disk on Minix --- neofetch | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index df8e007c..0295a29b 100755 --- a/neofetch +++ b/neofetch @@ -1552,10 +1552,16 @@ 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; } - [[ "$os" == "Haiku" ]] && { err "Disk doesn't work on Haiku due to the non-standard 'df'"; return; } + + # Get 'df' flags. + case "$os" in + "Haiku") err "Disk doesn't work on Haiku due to the non-standard 'df'"; return ;; + "Minix") df_flags=(-P -h) ;; + *) df_flags=(-h) ;; + esac # Get the info for / - disks=($(df -P -h /)) || { err "Disk: 'df' exited with error code 1"; return; } + disks=($(df "${df_flags[@]}" /)) || { err "Disk: 'df' exited with error code 1"; return; } # Put it all together disk_perc="${disks[11]/'%'}"