1
0
Fork 0

fix(archupdates): human-readable last patch date

This commit is contained in:
Oliver Ladner 2026-07-05 10:29:04 +02:00
commit c52cc66ff9

View file

@ -27,7 +27,12 @@ pkgupdate() {
local fg=$warn2_fg
fi
fi
local stat="$pkgcount pkg updates (last update: $hours_since_last_patched hours ago)"
if ((hours_since_last_patched >= 24)); then
local time_str="$(awk "BEGIN {printf \"%.1f\", int($hours_since_last_patched / 24 * 2 + 0.5) / 2}")d"
else
local time_str="${hours_since_last_patched}h"
fi
local stat="$pkgcount pkg updates (last update: ${time_str} ago)"
if [[ -n "$bg" ]]; then
echo -e "<span background=\"$bg\" color=\"$fg\">$stat</span>\n"