From 8bf7c1ede4bbfe81de79837ab9bce575a0600404 Mon Sep 17 00:00:00 2001 From: Tulip Blossom Date: Sun, 29 Dec 2024 19:43:11 -0300 Subject: [PATCH] chore: move motd to unified copr package --- build.sh | 1 + system_files/usr/libexec/ublue-motd | 41 --------- .../ublue-os/motd/{bluefin.md => template.md} | 0 .../usr/share/ublue-os/motd/themes/blue.json | 88 ------------------- .../usr/share/ublue-os/motd/themes/green.json | 88 ------------------- .../share/ublue-os/motd/themes/orange.json | 88 ------------------- .../usr/share/ublue-os/motd/themes/pink.json | 88 ------------------- .../share/ublue-os/motd/themes/purple.json | 88 ------------------- .../usr/share/ublue-os/motd/themes/red.json | 88 ------------------- .../usr/share/ublue-os/motd/themes/slate.json | 88 ------------------- .../usr/share/ublue-os/motd/themes/teal.json | 88 ------------------- .../share/ublue-os/motd/themes/yellow.json | 88 ------------------- .../ublue-os/motd/{ => tips}/20-bluefin.md | 0 13 files changed, 1 insertion(+), 833 deletions(-) delete mode 100755 system_files/usr/libexec/ublue-motd rename system_files/usr/share/ublue-os/motd/{bluefin.md => template.md} (100%) delete mode 100644 system_files/usr/share/ublue-os/motd/themes/blue.json delete mode 100644 system_files/usr/share/ublue-os/motd/themes/green.json delete mode 100644 system_files/usr/share/ublue-os/motd/themes/orange.json delete mode 100644 system_files/usr/share/ublue-os/motd/themes/pink.json delete mode 100644 system_files/usr/share/ublue-os/motd/themes/purple.json delete mode 100644 system_files/usr/share/ublue-os/motd/themes/red.json delete mode 100644 system_files/usr/share/ublue-os/motd/themes/slate.json delete mode 100644 system_files/usr/share/ublue-os/motd/themes/teal.json delete mode 100644 system_files/usr/share/ublue-os/motd/themes/yellow.json rename system_files/usr/share/ublue-os/motd/{ => tips}/20-bluefin.md (100%) diff --git a/build.sh b/build.sh index 4860b59..ab1f263 100755 --- a/build.sh +++ b/build.sh @@ -90,6 +90,7 @@ dnf -y --enablerepo copr:copr.fedorainfracloud.org:ublue-os:staging install \ -x bluefin-logos \ gnome-shell-extension-logo-menu \ uupd \ + ublue-motd \ bluefin-* dnf -y --enablerepo copr:copr.fedorainfracloud.org:ublue-os:staging swap centos-logos bluefin-logos diff --git a/system_files/usr/libexec/ublue-motd b/system_files/usr/libexec/ublue-motd deleted file mode 100755 index 106143d..0000000 --- a/system_files/usr/libexec/ublue-motd +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/bash -escape() { - sed 's/[&/\]/\\&/g' <<< "$1" -} - -TIP_FILE=$(find /usr/share/ublue-os/motd/tips/*.md | shuf -n 1) -if [[ -f "$TIP_FILE" ]]; then - IMAGE_INFO="/usr/share/ublue-os/image-info.json" - IMAGE_NAME=$(jq -r '."image-name"' < $IMAGE_INFO) - 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")" - - 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 - #shellcheck disable=2016 - TIP='# 󰇻 Your current image is over 1 month old, run `ujust update`' - fi - - TIP_ESCAPED=$(escape "$TIP") - -fi - -KEY_WARN_FILE="/run/user-motd-sbkey-warn.md" -[ -e $KEY_WARN_FILE ] && KEY_WARN="**WARNING**: $(cat $KEY_WARN_FILE)" -KEY_WARN_ESCAPED=$(escape "$KEY_WARN") - -THEME=$(gsettings get org.gnome.desktop.interface accent-color 2>/dev/null || echo "'slate'") -THEME=${THEME//\'/} -THEME=${MOTD_FORCE_THEME:-$THEME} - -sed -e "s/%IMAGE_NAME%/$IMAGE_NAME_ESCAPED/g" \ - -e "s/%IMAGE_TAG%/$IMAGE_TAG_ESCAPED/g" \ - -e "s/%TIP%/$TIP_ESCAPED/g" \ - -e "s/%KEY_WARN%/$KEY_WARN_ESCAPED/g" \ - /usr/share/ublue-os/motd/bluefin.md | tr '~' '\n' | /usr/bin/glow -s /usr/share/ublue-os/motd/themes/$THEME.json -w 78 - diff --git a/system_files/usr/share/ublue-os/motd/bluefin.md b/system_files/usr/share/ublue-os/motd/template.md similarity index 100% rename from system_files/usr/share/ublue-os/motd/bluefin.md rename to system_files/usr/share/ublue-os/motd/template.md diff --git a/system_files/usr/share/ublue-os/motd/themes/blue.json b/system_files/usr/share/ublue-os/motd/themes/blue.json deleted file mode 100644 index 099421a..0000000 --- a/system_files/usr/share/ublue-os/motd/themes/blue.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "document": { - "margin": 2 - }, - "block_quote": { - "indent": 1, - "indent_token": "│ " - }, - "paragraph": {}, - "list": { - "level_indent": 2 - }, - "heading": { - "block_suffix": "\n", - "color": "33", - "bold": true - }, - "h1": { - "block_prefix": "\n", - "block_suffix": "\n" - }, - "h2": { - "prefix": "▌ " - }, - "h3": { - "prefix": "┃ " - }, - "h4": { - "prefix": "│ " - }, - "h5": { - "prefix": "┆ " - }, - "h6": { - "prefix": "┊ ", - "bold": false - }, - "text": {}, - "strikethrough": { - "crossed_out": true - }, - "emph": { - "italic": true - }, - "strong": { - "color": "33", - "bold": true - }, - "hr": { - "format": "\n──────\n" - }, - "item": { - "block_prefix": "• " - }, - "enumeration": { - "block_prefix": ". " - }, - "task": { - "ticked": "[✓] ", - "unticked": "[ ] " - }, - "link": { - "underline": true - }, - "link_text": { - "bold": true - }, - "image": { - "underline": true - }, - "image_text": { - "format": "Image: {{.text}}" - }, - "code": { - "prefix": " ", - "suffix": " ", - "bold": true - }, - "code_block": {}, - "table": {}, - "definition_list": {}, - "definition_term": {}, - "definition_description": { - "block_prefix": "\n🠶 " - }, - "html_block": {}, - "html_span": {} -} diff --git a/system_files/usr/share/ublue-os/motd/themes/green.json b/system_files/usr/share/ublue-os/motd/themes/green.json deleted file mode 100644 index fd0326f..0000000 --- a/system_files/usr/share/ublue-os/motd/themes/green.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "document": { - "margin": 2 - }, - "block_quote": { - "indent": 1, - "indent_token": "│ " - }, - "paragraph": {}, - "list": { - "level_indent": 2 - }, - "heading": { - "block_suffix": "\n", - "color": "34", - "bold": true - }, - "h1": { - "block_prefix": "\n", - "block_suffix": "\n" - }, - "h2": { - "prefix": "▌ " - }, - "h3": { - "prefix": "┃ " - }, - "h4": { - "prefix": "│ " - }, - "h5": { - "prefix": "┆ " - }, - "h6": { - "prefix": "┊ ", - "bold": false - }, - "text": {}, - "strikethrough": { - "crossed_out": true - }, - "emph": { - "italic": true - }, - "strong": { - "color": "34", - "bold": true - }, - "hr": { - "format": "\n──────\n" - }, - "item": { - "block_prefix": "• " - }, - "enumeration": { - "block_prefix": ". " - }, - "task": { - "ticked": "[✓] ", - "unticked": "[ ] " - }, - "link": { - "underline": true - }, - "link_text": { - "bold": true - }, - "image": { - "underline": true - }, - "image_text": { - "format": "Image: {{.text}}" - }, - "code": { - "prefix": " ", - "suffix": " ", - "bold": true - }, - "code_block": {}, - "table": {}, - "definition_list": {}, - "definition_term": {}, - "definition_description": { - "block_prefix": "\n🠶 " - }, - "html_block": {}, - "html_span": {} -} diff --git a/system_files/usr/share/ublue-os/motd/themes/orange.json b/system_files/usr/share/ublue-os/motd/themes/orange.json deleted file mode 100644 index cd8ca16..0000000 --- a/system_files/usr/share/ublue-os/motd/themes/orange.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "document": { - "margin": 2 - }, - "block_quote": { - "indent": 1, - "indent_token": "│ " - }, - "paragraph": {}, - "list": { - "level_indent": 2 - }, - "heading": { - "block_suffix": "\n", - "color": "208", - "bold": true - }, - "h1": { - "block_prefix": "\n", - "block_suffix": "\n" - }, - "h2": { - "prefix": "▌ " - }, - "h3": { - "prefix": "┃ " - }, - "h4": { - "prefix": "│ " - }, - "h5": { - "prefix": "┆ " - }, - "h6": { - "prefix": "┊ ", - "bold": false - }, - "text": {}, - "strikethrough": { - "crossed_out": true - }, - "emph": { - "italic": true - }, - "strong": { - "color": "208", - "bold": true - }, - "hr": { - "format": "\n──────\n" - }, - "item": { - "block_prefix": "• " - }, - "enumeration": { - "block_prefix": ". " - }, - "task": { - "ticked": "[✓] ", - "unticked": "[ ] " - }, - "link": { - "underline": true - }, - "link_text": { - "bold": true - }, - "image": { - "underline": true - }, - "image_text": { - "format": "Image: {{.text}}" - }, - "code": { - "prefix": " ", - "suffix": " ", - "bold": true - }, - "code_block": {}, - "table": {}, - "definition_list": {}, - "definition_term": {}, - "definition_description": { - "block_prefix": "\n🠶 " - }, - "html_block": {}, - "html_span": {} -} diff --git a/system_files/usr/share/ublue-os/motd/themes/pink.json b/system_files/usr/share/ublue-os/motd/themes/pink.json deleted file mode 100644 index a5d65df..0000000 --- a/system_files/usr/share/ublue-os/motd/themes/pink.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "document": { - "margin": 2 - }, - "block_quote": { - "indent": 1, - "indent_token": "│ " - }, - "paragraph": {}, - "list": { - "level_indent": 2 - }, - "heading": { - "block_suffix": "\n", - "color": "212", - "bold": true - }, - "h1": { - "block_prefix": "\n", - "block_suffix": "\n" - }, - "h2": { - "prefix": "▌ " - }, - "h3": { - "prefix": "┃ " - }, - "h4": { - "prefix": "│ " - }, - "h5": { - "prefix": "┆ " - }, - "h6": { - "prefix": "┊ ", - "bold": false - }, - "text": {}, - "strikethrough": { - "crossed_out": true - }, - "emph": { - "italic": true - }, - "strong": { - "color": "212", - "bold": true - }, - "hr": { - "format": "\n──────\n" - }, - "item": { - "block_prefix": "• " - }, - "enumeration": { - "block_prefix": ". " - }, - "task": { - "ticked": "[✓] ", - "unticked": "[ ] " - }, - "link": { - "underline": true - }, - "link_text": { - "bold": true - }, - "image": { - "underline": true - }, - "image_text": { - "format": "Image: {{.text}}" - }, - "code": { - "prefix": " ", - "suffix": " ", - "bold": true - }, - "code_block": {}, - "table": {}, - "definition_list": {}, - "definition_term": {}, - "definition_description": { - "block_prefix": "\n🠶 " - }, - "html_block": {}, - "html_span": {} -} diff --git a/system_files/usr/share/ublue-os/motd/themes/purple.json b/system_files/usr/share/ublue-os/motd/themes/purple.json deleted file mode 100644 index 8abe445..0000000 --- a/system_files/usr/share/ublue-os/motd/themes/purple.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "document": { - "margin": 2 - }, - "block_quote": { - "indent": 1, - "indent_token": "│ " - }, - "paragraph": {}, - "list": { - "level_indent": 2 - }, - "heading": { - "block_suffix": "\n", - "color": "165", - "bold": true - }, - "h1": { - "block_prefix": "\n", - "block_suffix": "\n" - }, - "h2": { - "prefix": "▌ " - }, - "h3": { - "prefix": "┃ " - }, - "h4": { - "prefix": "│ " - }, - "h5": { - "prefix": "┆ " - }, - "h6": { - "prefix": "┊ ", - "bold": false - }, - "text": {}, - "strikethrough": { - "crossed_out": true - }, - "emph": { - "italic": true - }, - "strong": { - "color": "165", - "bold": true - }, - "hr": { - "format": "\n──────\n" - }, - "item": { - "block_prefix": "• " - }, - "enumeration": { - "block_prefix": ". " - }, - "task": { - "ticked": "[✓] ", - "unticked": "[ ] " - }, - "link": { - "underline": true - }, - "link_text": { - "bold": true - }, - "image": { - "underline": true - }, - "image_text": { - "format": "Image: {{.text}}" - }, - "code": { - "prefix": " ", - "suffix": " ", - "bold": true - }, - "code_block": {}, - "table": {}, - "definition_list": {}, - "definition_term": {}, - "definition_description": { - "block_prefix": "\n🠶 " - }, - "html_block": {}, - "html_span": {} -} diff --git a/system_files/usr/share/ublue-os/motd/themes/red.json b/system_files/usr/share/ublue-os/motd/themes/red.json deleted file mode 100644 index 700473d..0000000 --- a/system_files/usr/share/ublue-os/motd/themes/red.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "document": { - "margin": 2 - }, - "block_quote": { - "indent": 1, - "indent_token": "│ " - }, - "paragraph": {}, - "list": { - "level_indent": 2 - }, - "heading": { - "block_suffix": "\n", - "color": "203", - "bold": true - }, - "h1": { - "block_prefix": "\n", - "block_suffix": "\n" - }, - "h2": { - "prefix": "▌ " - }, - "h3": { - "prefix": "┃ " - }, - "h4": { - "prefix": "│ " - }, - "h5": { - "prefix": "┆ " - }, - "h6": { - "prefix": "┊ ", - "bold": false - }, - "text": {}, - "strikethrough": { - "crossed_out": true - }, - "emph": { - "italic": true - }, - "strong": { - "color": "203", - "bold": true - }, - "hr": { - "format": "\n──────\n" - }, - "item": { - "block_prefix": "• " - }, - "enumeration": { - "block_prefix": ". " - }, - "task": { - "ticked": "[✓] ", - "unticked": "[ ] " - }, - "link": { - "underline": true - }, - "link_text": { - "bold": true - }, - "image": { - "underline": true - }, - "image_text": { - "format": "Image: {{.text}}" - }, - "code": { - "prefix": " ", - "suffix": " ", - "bold": true - }, - "code_block": {}, - "table": {}, - "definition_list": {}, - "definition_term": {}, - "definition_description": { - "block_prefix": "\n🠶 " - }, - "html_block": {}, - "html_span": {} -} diff --git a/system_files/usr/share/ublue-os/motd/themes/slate.json b/system_files/usr/share/ublue-os/motd/themes/slate.json deleted file mode 100644 index 3fbf5e8..0000000 --- a/system_files/usr/share/ublue-os/motd/themes/slate.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "document": { - "margin": 2 - }, - "block_quote": { - "indent": 1, - "indent_token": "│ " - }, - "paragraph": {}, - "list": { - "level_indent": 2 - }, - "heading": { - "block_suffix": "\n", - "color": "104", - "bold": true - }, - "h1": { - "block_prefix": "\n", - "block_suffix": "\n" - }, - "h2": { - "prefix": "▌ " - }, - "h3": { - "prefix": "┃ " - }, - "h4": { - "prefix": "│ " - }, - "h5": { - "prefix": "┆ " - }, - "h6": { - "prefix": "┊ ", - "bold": false - }, - "text": {}, - "strikethrough": { - "crossed_out": true - }, - "emph": { - "italic": true - }, - "strong": { - "color": "104", - "bold": true - }, - "hr": { - "format": "\n──────\n" - }, - "item": { - "block_prefix": "• " - }, - "enumeration": { - "block_prefix": ". " - }, - "task": { - "ticked": "[✓] ", - "unticked": "[ ] " - }, - "link": { - "underline": true - }, - "link_text": { - "bold": true - }, - "image": { - "underline": true - }, - "image_text": { - "format": "Image: {{.text}}" - }, - "code": { - "prefix": " ", - "suffix": " ", - "bold": true - }, - "code_block": {}, - "table": {}, - "definition_list": {}, - "definition_term": {}, - "definition_description": { - "block_prefix": "\n🠶 " - }, - "html_block": {}, - "html_span": {} -} diff --git a/system_files/usr/share/ublue-os/motd/themes/teal.json b/system_files/usr/share/ublue-os/motd/themes/teal.json deleted file mode 100644 index 1e0bc72..0000000 --- a/system_files/usr/share/ublue-os/motd/themes/teal.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "document": { - "margin": 2 - }, - "block_quote": { - "indent": 1, - "indent_token": "│ " - }, - "paragraph": {}, - "list": { - "level_indent": 2 - }, - "heading": { - "block_suffix": "\n", - "color": "44", - "bold": true - }, - "h1": { - "block_prefix": "\n", - "block_suffix": "\n" - }, - "h2": { - "prefix": "▌ " - }, - "h3": { - "prefix": "┃ " - }, - "h4": { - "prefix": "│ " - }, - "h5": { - "prefix": "┆ " - }, - "h6": { - "prefix": "┊ ", - "bold": false - }, - "text": {}, - "strikethrough": { - "crossed_out": true - }, - "emph": { - "italic": true - }, - "strong": { - "color": "44", - "bold": true - }, - "hr": { - "format": "\n──────\n" - }, - "item": { - "block_prefix": "• " - }, - "enumeration": { - "block_prefix": ". " - }, - "task": { - "ticked": "[✓] ", - "unticked": "[ ] " - }, - "link": { - "underline": true - }, - "link_text": { - "bold": true - }, - "image": { - "underline": true - }, - "image_text": { - "format": "Image: {{.text}}" - }, - "code": { - "prefix": " ", - "suffix": " ", - "bold": true - }, - "code_block": {}, - "table": {}, - "definition_list": {}, - "definition_term": {}, - "definition_description": { - "block_prefix": "\n🠶 " - }, - "html_block": {}, - "html_span": {} -} diff --git a/system_files/usr/share/ublue-os/motd/themes/yellow.json b/system_files/usr/share/ublue-os/motd/themes/yellow.json deleted file mode 100644 index 24b268e..0000000 --- a/system_files/usr/share/ublue-os/motd/themes/yellow.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "document": { - "margin": 2 - }, - "block_quote": { - "indent": 1, - "indent_token": "│ " - }, - "paragraph": {}, - "list": { - "level_indent": 2 - }, - "heading": { - "block_suffix": "\n", - "color": "220", - "bold": true - }, - "h1": { - "block_prefix": "\n", - "block_suffix": "\n" - }, - "h2": { - "prefix": "▌ " - }, - "h3": { - "prefix": "┃ " - }, - "h4": { - "prefix": "│ " - }, - "h5": { - "prefix": "┆ " - }, - "h6": { - "prefix": "┊ ", - "bold": false - }, - "text": {}, - "strikethrough": { - "crossed_out": true - }, - "emph": { - "italic": true - }, - "strong": { - "color": "220", - "bold": true - }, - "hr": { - "format": "\n──────\n" - }, - "item": { - "block_prefix": "• " - }, - "enumeration": { - "block_prefix": ". " - }, - "task": { - "ticked": "[✓] ", - "unticked": "[ ] " - }, - "link": { - "underline": true - }, - "link_text": { - "bold": true - }, - "image": { - "underline": true - }, - "image_text": { - "format": "Image: {{.text}}" - }, - "code": { - "prefix": " ", - "suffix": " ", - "bold": true - }, - "code_block": {}, - "table": {}, - "definition_list": {}, - "definition_term": {}, - "definition_description": { - "block_prefix": "\n🠶 " - }, - "html_block": {}, - "html_span": {} -} diff --git a/system_files/usr/share/ublue-os/motd/20-bluefin.md b/system_files/usr/share/ublue-os/motd/tips/20-bluefin.md similarity index 100% rename from system_files/usr/share/ublue-os/motd/20-bluefin.md rename to system_files/usr/share/ublue-os/motd/tips/20-bluefin.md