commit b735e08dd90b4bce25f64a16a7a0dd76eeb57ffe parent 72a71ce6b3519d5c799826874881ac20c063bdab Author: Byron Torres <b@torresjrjr.com> Date: Mon, 21 Feb 2022 16:48:50 +0000 Use sh, not dc, for _uptime() Diffstat:
M | fetch | | | 8 | +++----- |
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/fetch b/fetch @@ -50,11 +50,9 @@ _os() { env printf "$1" "$(uname -o) $(uname -r)" } _uptime() { - s=$(cat /proc/uptime); s=${s%%.*} - stopwatch="$(env printf '%sd %sh %sm' \ - $(env printf '%s' "$s dd 86400/p3R 3600/24%p3R 60/60%p3R" | dc) - )" - env printf "$1" "$stopwatch (${s}s)" + s=$(cat /proc/uptime) s=${s%%.*} + days=$(($s / 86400)) mins=$(($s / 3600 % 24)) hours=$(($s / 60 % 60)) + env printf "$1" "${days}d ${mins}m ${hours}h (${s}s)" } _shell() { env printf "$1" "$(readlink /proc/$PPID/exe)"