diff --git a/usr/libexec/ublue-motd b/usr/libexec/ublue-motd index 760f6a53cc2..49ecd134acb 100755 --- a/usr/libexec/ublue-motd +++ b/usr/libexec/ublue-motd @@ -10,7 +10,18 @@ if [[ -f "$TIP_FILE" ]]; then IMAGE_NAME_ESCAPED=$(escape "$IMAGE_NAME") IMAGE_TAG=$(jq -r '."image-tag"' < $IMAGE_INFO) IMAGE_TAG_ESCAPED=$(escape "$IMAGE_TAG") - TIP=$(shuf -n 1 "$TIP_FILE") + TIP="󰋼 $(shuf -n 1 "$TIP_FILE")" + + IMAGE_DATE=$(rpm-ostree status --booted | sed -n 's/.*Timestamp: \(.*\)/\1/p') + IMAGE_DATE_SECONDS=$(date -d "$IMAGE_DATE" +%s) + CURRENT_SECONDS=$(date +%s) + DIFFERENCE=$((CURRENT_SECONDS - IMAGE_DATE_SECONDS)) + MONTH=$((30 * 24 * 60 * 60)) + if [ "$DIFFERENCE" -ge "$MONTH" ]; then + TIP='# 󰇻 Your current image is over 1 month old, run `ujust update`' + fi + TIP_ESCAPED=$(escape "$TIP") + sed -e "s/%IMAGE_NAME%/$IMAGE_NAME_ESCAPED/g" -e "s/%IMAGE_TAG%/$IMAGE_TAG_ESCAPED/g" -e "s/%TIP%/$TIP_ESCAPED/g" /usr/share/ublue-os/motd/bluefin.md | /usr/bin/glow -s auto - fi \ No newline at end of file diff --git a/usr/share/ublue-os/motd/bluefin.md b/usr/share/ublue-os/motd/bluefin.md index 8f2e164e935..88b6ea190c8 100644 --- a/usr/share/ublue-os/motd/bluefin.md +++ b/usr/share/ublue-os/motd/bluefin.md @@ -1,5 +1,5 @@ # 󱍢 Welcome to Bluefin (󰂡eta) -: `%IMAGE_NAME%:%IMAGE_TAG%` +󱋩: `%IMAGE_NAME%:%IMAGE_TAG%` |  Command | Description | | ------- | ----------- | @@ -7,7 +7,7 @@ | `ujust toggle-user-motd` | Toggle this banner on/off | | `ujust bluefin-cli` | Configure the terminal (Alpha) | -Tip: %TIP% +%TIP% - 󰊤 [Issues](https://issues.projectbluefin.io) - 󰈙 [Documentation:](http://docs.projectbluefin.io/)