fix(archupdates): human-readable last patch date
This commit is contained in:
parent
15f8b003e0
commit
c52cc66ff9
1 changed files with 6 additions and 1 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue