Skip to content

Commit

Permalink
Fixed some Bluefin stomping
Browse files Browse the repository at this point in the history
Added Bazzite DX motd
  • Loading branch information
Sparkrai committed Jun 14, 2024
1 parent cdede94 commit e02d70e
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 14 deletions.
28 changes: 28 additions & 0 deletions files/files/shared/usr/libexec/ublue-motd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/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")

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/bazzite-dx.md | tr '~' '\n' | /usr/bin/glow -s auto -
fi
16 changes: 16 additions & 0 deletions files/files/shared/usr/share/ublue-os/motd/bazzite-dx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 󱍢 Welcome to Bazzite DX
󱋩 `%IMAGE_NAME%:%IMAGE_TAG%`

|  Command | Description |
| ------- | ----------- |
| `ujust --choose` | Show available commands |
| `ujust toggle-user-motd` | Toggle banner on/off |
| `ujust bluefin-cli` | Enable terminal bling |
| `brew help` | Manage command line packages |

%TIP%

- 󰊤 [Issues](https://github.com/Sparkrai/bazzite-dx/issues)
- 󰊤 [Bazzite Documentation](https://universal-blue.discourse.group/docs?topic=561)
- 󰈙 [Bluefin Documentation](http://docs.projectbluefin.io/)
- 󰊌 [Discuss](https://universal-blue.discourse.group/c/bazzite/5)
20 changes: 10 additions & 10 deletions files/just/bluefin-system.just
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ devmode:
if grep -q "/var/ublue-os/image" <<< $CURRENT_IMAGE
then
echo ""
echo "Before we can switch to the Bluefin Developer Experience"
echo "Before we can switch to the Bazzite Developer Experience"
echo "the current system needs an update. Please run 'just update'"
echo "and reboot your system when the update is finished."
exit
Expand Down Expand Up @@ -262,14 +262,14 @@ install-system-flatpaks:
configure-grub:
@/usr/libexec/configure-grub.sh

# Rebase assistant
rebase-helper:
@/usr/bin/ublue-rollback-helper
# # Rebase assistant
# rebase-helper:
# @/usr/bin/ublue-rollback-helper

alias rollback-helper := rebase-helper
# alias rollback-helper := rebase-helper

update-ng:
echo "Note: This command doesn't work if you have locally layered packages"
sudo bootc upgrade
flatpak update -y
brew upgrade
# update-ng:
# echo "Note: This command doesn't work if you have locally layered packages"
# sudo bootc upgrade
# flatpak update -y
# brew upgrade
7 changes: 3 additions & 4 deletions recipes/bazzite-gnome-dx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ modules:
- ../bluefin/system_files/shared/usr/share/ublue-os/bluefin-cli: /usr/share/ublue-os/bluefin-cli
- ../bluefin/system_files/shared/usr/share/ublue-os/homebrew: /usr/share/ublue-os/homebrew
- ../bluefin/system_files/shared/usr/share/ublue-os/quadlets: /usr/share/ublue-os/quadlets
- ../bluefin/system_files/shared/usr/share/ublue-os/ublue-os.jsonc: /usr/share/ublue-os/ublue-os.jsonc
- ../bluefin/system_files/silverblue/usr/etc/flatpak: /usr/etc/flatpak
# - ../bluefin/system_files/silverblue/usr/share: /usr/share # Avoid Bluefin branding
- ../bluefin/system_files/dx: /
Expand All @@ -49,9 +48,9 @@ modules:
- simple-scan
- gnome-shell-extension-appindicator
- gnome-shell-extension-blur-my-shell
- gnome-shell-extension-caffeine
# - gnome-shell-extension-caffeine # Already in Bazzite
- gnome-shell-extension-dash-to-dock
- gnome-shell-extension-gsconnect
# - gnome-shell-extension-gsconnect # Already in Bazzite
- libgda-sqlite
- libgda
- libratbag-ratbagd
Expand All @@ -67,7 +66,7 @@ modules:

- type: gnome-extensions
install:
- Logo Menu
# - Logo Menu # Already in Bazzite
- Search Light

# Install Starhip and activate RPM Fusion repos
Expand Down

0 comments on commit e02d70e

Please sign in to comment.