New uptime formatting
This commit is contained in:
parent
b193b9e5d5
commit
a2712b6333
23
neofetch
23
neofetch
|
@ -594,26 +594,11 @@ getuptime () {
|
||||||
echo "$hours"
|
echo "$hours"
|
||||||
echo "$days"
|
echo "$days"
|
||||||
|
|
||||||
# Format the output like Linux's "uptime -p" cmd.
|
days="$days days,"
|
||||||
if [ "$mins" == 1 ]; then
|
hours="$hours hours,"
|
||||||
uptime="$mins minute"
|
mins="$mins minutes"
|
||||||
elif [ "$mins" != 0 ]; then
|
|
||||||
uptime="$mins minutes"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$hours" == 1 ]; then
|
uptime="up ${days/0 days,} ${hours/ 0 hours,} ${mins/0 mins}"
|
||||||
uptime="$hours hour, $uptime"
|
|
||||||
elif [ "$mins" != 0 ]; then
|
|
||||||
uptime="$hours hours, $uptime"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$days" == 1 ]; then
|
|
||||||
uptime="$days day, $uptime"
|
|
||||||
elif [ "$days" != 0 ]; then
|
|
||||||
uptime="$days days, $uptime"
|
|
||||||
fi
|
|
||||||
|
|
||||||
uptime="up $uptime"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Reference in New Issue