From 837a73bb577d49239d3f924e6a0f145054f15811 Mon Sep 17 00:00:00 2001 From: Tulip Blossom Date: Sat, 11 Jan 2025 12:24:15 -0300 Subject: [PATCH] chore: move MOTD configuration to ublue-motd --- packages.json | 1 + system_files/shared/usr/libexec/ublue-motd | 41 --------- .../vendor_functions.d/fish_greeting.fish | 16 ---- .../usr/share/ublue-os/motd/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 ------------------- 13 files changed, 1 insertion(+), 849 deletions(-) delete mode 100755 system_files/shared/usr/libexec/ublue-motd delete mode 100644 system_files/shared/usr/share/fish/vendor_functions.d/fish_greeting.fish rename system_files/{kinoite/usr/share/ublue-os/motd/aurora.md => shared/usr/share/ublue-os/motd/template.md} (100%) delete mode 100644 system_files/shared/usr/share/ublue-os/motd/themes/blue.json delete mode 100644 system_files/shared/usr/share/ublue-os/motd/themes/green.json delete mode 100644 system_files/shared/usr/share/ublue-os/motd/themes/orange.json delete mode 100644 system_files/shared/usr/share/ublue-os/motd/themes/pink.json delete mode 100644 system_files/shared/usr/share/ublue-os/motd/themes/purple.json delete mode 100644 system_files/shared/usr/share/ublue-os/motd/themes/red.json delete mode 100644 system_files/shared/usr/share/ublue-os/motd/themes/slate.json delete mode 100644 system_files/shared/usr/share/ublue-os/motd/themes/teal.json delete mode 100644 system_files/shared/usr/share/ublue-os/motd/themes/yellow.json diff --git a/packages.json b/packages.json index 7e94471b..637f8c8a 100644 --- a/packages.json +++ b/packages.json @@ -60,6 +60,7 @@ "tmux", "usbmuxd", "ublue-bling", + "ublue-motd", "wireguard-tools", "xprop", "wl-clipboard", diff --git a/system_files/shared/usr/libexec/ublue-motd b/system_files/shared/usr/libexec/ublue-motd deleted file mode 100755 index 037c093c..00000000 --- a/system_files/shared/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 || 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/aurora.md | tr '~' '\n' | /usr/bin/glow -s /usr/share/ublue-os/motd/themes/$THEME.json -w 78 - diff --git a/system_files/shared/usr/share/fish/vendor_functions.d/fish_greeting.fish b/system_files/shared/usr/share/fish/vendor_functions.d/fish_greeting.fish deleted file mode 100644 index bdc2ba25..00000000 --- a/system_files/shared/usr/share/fish/vendor_functions.d/fish_greeting.fish +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/fish -#shellcheck disable=all - -function fish_greeting - if test -d "$HOME" - if test ! -e "$HOME"/.config/no-show-user-motd - if test -x "/usr/libexec/ublue-motd" - /usr/libexec/ublue-motd - end - end - end - - if set -q fish_private_mode - echo "fish is running in private mode, history will not be persisted." - end -end diff --git a/system_files/kinoite/usr/share/ublue-os/motd/aurora.md b/system_files/shared/usr/share/ublue-os/motd/template.md similarity index 100% rename from system_files/kinoite/usr/share/ublue-os/motd/aurora.md rename to system_files/shared/usr/share/ublue-os/motd/template.md diff --git a/system_files/shared/usr/share/ublue-os/motd/themes/blue.json b/system_files/shared/usr/share/ublue-os/motd/themes/blue.json deleted file mode 100644 index 099421a1..00000000 --- a/system_files/shared/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/shared/usr/share/ublue-os/motd/themes/green.json b/system_files/shared/usr/share/ublue-os/motd/themes/green.json deleted file mode 100644 index fd0326f7..00000000 --- a/system_files/shared/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/shared/usr/share/ublue-os/motd/themes/orange.json b/system_files/shared/usr/share/ublue-os/motd/themes/orange.json deleted file mode 100644 index cd8ca161..00000000 --- a/system_files/shared/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/shared/usr/share/ublue-os/motd/themes/pink.json b/system_files/shared/usr/share/ublue-os/motd/themes/pink.json deleted file mode 100644 index a5d65df5..00000000 --- a/system_files/shared/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/shared/usr/share/ublue-os/motd/themes/purple.json b/system_files/shared/usr/share/ublue-os/motd/themes/purple.json deleted file mode 100644 index 8abe4451..00000000 --- a/system_files/shared/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/shared/usr/share/ublue-os/motd/themes/red.json b/system_files/shared/usr/share/ublue-os/motd/themes/red.json deleted file mode 100644 index 700473dd..00000000 --- a/system_files/shared/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/shared/usr/share/ublue-os/motd/themes/slate.json b/system_files/shared/usr/share/ublue-os/motd/themes/slate.json deleted file mode 100644 index 3fbf5e82..00000000 --- a/system_files/shared/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/shared/usr/share/ublue-os/motd/themes/teal.json b/system_files/shared/usr/share/ublue-os/motd/themes/teal.json deleted file mode 100644 index 1e0bc72e..00000000 --- a/system_files/shared/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/shared/usr/share/ublue-os/motd/themes/yellow.json b/system_files/shared/usr/share/ublue-os/motd/themes/yellow.json deleted file mode 100644 index 24b268ef..00000000 --- a/system_files/shared/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": {} -}