Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neofetch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
neofetch
Commits
c1b320de
Commit
c1b320de
authored
Jan 06, 2017
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disk: Use -h for all OS but Haiku
parent
6c265896
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
neofetch
neofetch
+2
-8
No files found.
neofetch
View file @
c1b320de
...
@@ -1614,17 +1614,11 @@ get_term_font() {
...
@@ -1614,17 +1614,11 @@ 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
"
${
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.
# Stop here if 'df' fails to print disk info.
[[
-z
"
${
disks
[@]
}
"
]]
&&
\
[[
-z
"
${
disks
[@]
}
"
]]
&&
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment