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
b3f7479e
Commit
b3f7479e
authored
Dec 15, 2016
by
Dylan Araps
Committed by
GitHub
Dec 15, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #534 from dylanaraps/uptime
Uptime: Rewrite part of uptime
parents
0a3505fc
856cabf7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
18 deletions
+16
-18
config
config/config
+2
-2
neofetch
neofetch
+14
-16
No files found.
config/config
View file @
b3f7479e
...
@@ -92,7 +92,7 @@ os_arch="on"
...
@@ -92,7 +92,7 @@ os_arch="on"
# Shorten the output of the uptime function
# Shorten the output of the uptime function
#
#
# Default: 'o
ff
'
# Default: 'o
n
'
# Values: 'on', 'off', 'tiny'
# Values: 'on', 'off', 'tiny'
# Flag: --uptime_shorthand
# Flag: --uptime_shorthand
#
#
...
@@ -100,7 +100,7 @@ os_arch="on"
...
@@ -100,7 +100,7 @@ os_arch="on"
# on: '2 days, 10 hours, 3 mins'
# on: '2 days, 10 hours, 3 mins'
# off: '2 days, 10 hours, 3 minutes'
# off: '2 days, 10 hours, 3 minutes'
# tiny: '2d 10h 3m'
# tiny: '2d 10h 3m'
uptime_shorthand
=
"o
ff
"
uptime_shorthand
=
"o
n
"
# Shell
# Shell
...
...
neofetch
View file @
b3f7479e
...
@@ -329,24 +329,22 @@ get_uptime() {
...
@@ -329,24 +329,22 @@ get_uptime() {
days
=
"
$((
seconds
/
60
/
60
/
24
))
days"
days
=
"
$((
seconds
/
60
/
60
/
24
))
days"
hours
=
"
$((
seconds
/
60
/
60
%
24
))
hours"
hours
=
"
$((
seconds
/
60
/
60
%
24
))
hours"
minutes
=
"
$((
seconds
/
60
%
60
))
minutes"
mins
=
"
$((
seconds
/
60
%
60
))
minutes"
case
"
$days
"
in
# Format the days, hours and minutes.
"0 days"
)
unset
days
;;
strip_date
()
{
"1 days"
)
days
=
"
${
days
/s
}
"
;;
case
"
$1
"
in
esac
"0 "
*
)
unset
"
${
1
/*
}
"
;;
"1 "
*
)
printf
"%s"
"
${
1
/s
}
"
;;
case
"
$hours
"
in
*
)
printf
"%s"
"
$1
"
;;
"0 hours"
)
unset
hours
;;
esac
"1 hours"
)
hours
=
"
${
hours
/s
}
"
;;
}
esac
case
"
$minutes
"
in
days
=
"
$(
strip_date
"
$days
"
)
"
"0 minutes"
)
unset
minutes
;;
hours
=
"
$(
strip_date
"
$hours
"
)
"
"1 minutes"
)
minutes
=
"
${
minutes
/s
}
"
;;
mins
=
"
$(
strip_date
"
$mins
"
)
"
esac
uptime
=
"
${
days
:+
$days
,
}${
hours
:+
$hours
,
}${
min
ute
s
}
"
uptime
=
"
${
days
:+
$days
,
}${
hours
:+
$hours
,
}${
mins
}
"
uptime
=
"
${
uptime
%
', '
}
"
uptime
=
"
${
uptime
%
', '
}
"
uptime
=
"
${
uptime
:-${
seconds
}
seconds
}
"
uptime
=
"
${
uptime
:-${
seconds
}
seconds
}
"
;;
;;
...
...
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