diff --git a/home/oli/bin/i3blocks/archupdates b/home/oli/bin/i3blocks/archupdates index 0fd54be..5783f35 100755 --- a/home/oli/bin/i3blocks/archupdates +++ b/home/oli/bin/i3blocks/archupdates @@ -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 "$stat\n"