fetch

MSYS2-compatible system info prompt
git clone https://git.torresjrjr.com/fetch.git
Log | Files | Refs | README | LICENSE

commit 6fe8c788178d197fbd7c7e74fc7a2884d3295e4e
parent fcab70437618450db087f89d071532320fb477bd
Author: Byron Torres <b@torresjrjr.com>
Date:   Wed,  2 Mar 2022 12:09:17 +0000

Display boot datetime in _uptime()

Diffstat:
Mfetch | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fetch b/fetch @@ -54,9 +54,10 @@ _uptime() { [ -r /proc/uptime ] && { s=$(cat /proc/uptime) s=${s%%.*} days=$(($s / 86400)) hours=$(($s / 3600 % 24)) mins=$(($s / 60 % 60)) - env printf "$1" "${days}d ${hours}h ${mins}m (${s}s)" + since=$(date -d @$(($(date +%s) - $s)) +'%b %d. %H:%M') + env printf "$1" "${days}d ${hours}h ${mins}m -- ${since}" } || { - env printf "$1" "$(uptime --pretty 2>&- || uptime)" + env printf "$1" "$(uptime --pretty 2>&- || uptime) -- $(uptime -s)" } } _shell() {