Disk: Revert previous commits
This commit is contained in:
parent
50bd2eb9d7
commit
2404a5e0ad
1 changed files with 8 additions and 7 deletions
15
neofetch
15
neofetch
|
@ -1614,11 +1614,17 @@ get_term_font() {
|
||||||
|
|
||||||
get_disk() {
|
get_disk() {
|
||||||
type -p df >/dev/null 2>&1 || { err "Disk requires 'df' to function. Install 'df' to get disk info."; return; }
|
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 ;;
|
||||||
|
"Mac OS X") df_flags=(-P -h) ;;
|
||||||
|
*) df_flags=(-h) ;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Create an array called 'disks' where each element is a separate line from
|
# 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.
|
# df's output. We then unset the first element which removes the column titles.
|
||||||
readarray disks < <(df -h "${disk_show[@]:-/}") && unset 'disks[0]'
|
readarray disks < <(df "${df_flags[@]}" "${disk_show[@]:-/}") && unset 'disks[0]'
|
||||||
|
|
||||||
# Stop here if 'df' fails to print disk info.
|
# Stop here if 'df' fails to print disk info.
|
||||||
[[ -z "${disks[@]}" ]] && \
|
[[ -z "${disks[@]}" ]] && \
|
||||||
|
@ -1642,11 +1648,6 @@ get_disk() {
|
||||||
# Append '(disk mount point)' to the subtitle.
|
# Append '(disk mount point)' to the subtitle.
|
||||||
prin "${subtitle} (${disk_info[5]})" "$disk"
|
prin "${subtitle} (${disk_info[5]})" "$disk"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Temporary test for mac OS.
|
|
||||||
df -h "${disk_show[@]:-/}"
|
|
||||||
df -h /
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get_battery() {
|
get_battery() {
|
||||||
|
|
Loading…
Reference in a new issue