From 7dac8843f14d14e9c6f43b255fd32a7e17e063b2 Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Tue, 4 Jul 2017 19:51:28 +0700 Subject: [PATCH] Disk [HP-UX]: Add initial support --- neofetch | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 66d6c330..3e4e655b 100755 --- a/neofetch +++ b/neofetch @@ -1917,7 +1917,10 @@ get_disk() { # 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. IFS=$'\n' - disks=($(df "${df_flags[@]}" "${disk_show[@]:-/}" 2>/dev/null)) + case "$os" in + "HP-UX") disks=($(bdf "${disk_show[@]:-/}" 2>/dev/null)); df_version="bdf" ;; + *) disks=($(df "${df_flags[@]}" "${disk_show[@]:-/}" 2>/dev/null)) ;; + esac unset 'disks[0]' IFS="$old_ifs" @@ -1931,7 +1934,7 @@ get_disk() { disk_perc="${disk_info[4]/'%'}" case "$df_version" in - *"befhikm"*) disk="$((disk_info[2]/1024/1024))G / $((disk_info[1]/1024/1024))G (${disk_perc}%)" ;; + *"befhikm"*|"bdf") disk="$((disk_info[2]/1024/1024))G / $((disk_info[1]/1024/1024))G (${disk_perc}%)" ;; *) disk="${disk_info[2]/i} / ${disk_info[1]/i} (${disk_perc}%)" ;; esac