From 7ed7e7fe7352357fc8a0ad86835f94d037a9f3cd Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Sun, 28 Jan 2024 21:20:02 -0800 Subject: [PATCH 1/3] fix: Escape special characters in motd script --- system_files/desktop/shared/usr/libexec/ublue-motd | 9 ++++++++- .../desktop/shared/usr/share/ublue-os/motd/bazzite.md | 2 +- .../usr/share/ublue-os/motd/tips/10-desktop-tips.md | 6 +++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/system_files/desktop/shared/usr/libexec/ublue-motd b/system_files/desktop/shared/usr/libexec/ublue-motd index a8963e10..9afe6d19 100755 --- a/system_files/desktop/shared/usr/libexec/ublue-motd +++ b/system_files/desktop/shared/usr/libexec/ublue-motd @@ -1,9 +1,16 @@ #!/usr/bin/bash +escape() { + sed 's/[&/\]/\\&/g' <<< "$1" +} + TIP_FILE=$(ls "/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") - sed -e "s/%IMAGE_NAME%/$IMAGE_NAME/g" -e "s/%IMAGE_TAG%/$IMAGE_TAG/g" -e "s/%TIP%/$TIP/g" /usr/share/ublue-os/motd/bazzite.md | /usr/bin/glow -s auto - + 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.md | /usr/bin/glow -s auto - fi \ No newline at end of file diff --git a/system_files/desktop/shared/usr/share/ublue-os/motd/bazzite.md b/system_files/desktop/shared/usr/share/ublue-os/motd/bazzite.md index 8ee98b63..459ca434 100644 --- a/system_files/desktop/shared/usr/share/ublue-os/motd/bazzite.md +++ b/system_files/desktop/shared/usr/share/ublue-os/motd/bazzite.md @@ -7,7 +7,7 @@ | `ujust toggle-user-motd` | Toggle this banner on/off | | `neofetch` | View system information | -󰋼 *%TIP%* +󰋼 %TIP% - [ Report an issue](https://github.com/ublue-os/bazzite/issues) - [󰙯 Discord](https://discord.bazzite.gg/) - [󰈙 Documentation](http://docs.bazzite.gg/) \ No newline at end of file diff --git a/system_files/desktop/shared/usr/share/ublue-os/motd/tips/10-desktop-tips.md b/system_files/desktop/shared/usr/share/ublue-os/motd/tips/10-desktop-tips.md index 571b6b3f..5cf34577 100644 --- a/system_files/desktop/shared/usr/share/ublue-os/motd/tips/10-desktop-tips.md +++ b/system_files/desktop/shared/usr/share/ublue-os/motd/tips/10-desktop-tips.md @@ -1,5 +1,5 @@ It is **always** better to install packages with Distrobox than to layer them with rpm-ostree. `ujust distrobox` makes it easy! -Packages installed in Distrobox can be exported to appear like any other application ([View documentation](https://github.com/89luca89/distrobox/blob/main/docs/usage/distrobox-export.md)). -Update break something? You can roll back and pin the previous release or rebase by build date ([View our guide](https://universal-blue.discourse.group/docs?topic=513)). +Packages installed in Distrobox can be exported to appear like any other application - [View documentation](https://github.com/89luca89/distrobox/blob/main/docs/usage/distrobox-export.md). +Update break something? You can roll back and pin the previous release or rebase by build date - [View our guide](https://universal-blue.discourse.group/docs?topic=513). Installing a non-Steam Windows game? Lutris is pre-installed for better handling of wine prefixes. -BTRFS is used by default for external drives, and we recommend that or EXT4 over NTFS ([More info here](https://github.com/ValveSoftware/Proton/wiki/Using-a-NTFS-disk-with-Linux-and-Windows)). \ No newline at end of file +BTRFS is used by default for external drives, and we recommend that or EXT4 over NTFS - [More info here](https://github.com/ValveSoftware/Proton/wiki/Using-a-NTFS-disk-with-Linux-and-Windows). \ No newline at end of file From 74e896834447fbbd1c997a01b9919e500dd239dd Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Mon, 29 Jan 2024 00:57:48 -0800 Subject: [PATCH 2/3] chore: Add a ton of new tips, split bazzite tips from generic ones that could be upstreamed --- .../shared/usr/share/ublue-os/motd/tips/20-deck-tips.md | 2 -- .../shared/usr/share/ublue-os/motd/tips/25-bazzite-deck.md | 3 +++ .../desktop/kinoite/usr/share/ublue-os/motd/tips/30-kde.md | 3 +++ .../shared/usr/share/ublue-os/motd/tips/10-desktop-tips.md | 5 ----- .../shared/usr/share/ublue-os/motd/tips/10-ublue.md | 3 +++ .../shared/usr/share/ublue-os/motd/tips/20-bazzite.md | 7 +++++++ .../silverblue/usr/share/ublue-os/motd/tips/30-gnome.md | 3 +++ .../shared/usr/share/ublue-os/motd/tips/100-nvidia.md | 1 + .../shared/usr/share/ublue-os/motd/tips/30-nvidia-tips.md | 1 - 9 files changed, 20 insertions(+), 8 deletions(-) delete mode 100644 system_files/deck/shared/usr/share/ublue-os/motd/tips/20-deck-tips.md create mode 100644 system_files/deck/shared/usr/share/ublue-os/motd/tips/25-bazzite-deck.md create mode 100644 system_files/desktop/kinoite/usr/share/ublue-os/motd/tips/30-kde.md delete mode 100644 system_files/desktop/shared/usr/share/ublue-os/motd/tips/10-desktop-tips.md create mode 100644 system_files/desktop/shared/usr/share/ublue-os/motd/tips/10-ublue.md create mode 100644 system_files/desktop/shared/usr/share/ublue-os/motd/tips/20-bazzite.md create mode 100644 system_files/desktop/silverblue/usr/share/ublue-os/motd/tips/30-gnome.md create mode 100644 system_files/nvidia/shared/usr/share/ublue-os/motd/tips/100-nvidia.md delete mode 100644 system_files/nvidia/shared/usr/share/ublue-os/motd/tips/30-nvidia-tips.md diff --git a/system_files/deck/shared/usr/share/ublue-os/motd/tips/20-deck-tips.md b/system_files/deck/shared/usr/share/ublue-os/motd/tips/20-deck-tips.md deleted file mode 100644 index fcfca107..00000000 --- a/system_files/deck/shared/usr/share/ublue-os/motd/tips/20-deck-tips.md +++ /dev/null @@ -1,2 +0,0 @@ -Using a handheld other than the Steam Deck? Check out our alternative handheld documentation [here](https://github.com/ublue-os/bazzite#alternative-handhelds). -Want to install Decky Loader? There's a `ujust` command for that! `ujust get-decky` \ No newline at end of file diff --git a/system_files/deck/shared/usr/share/ublue-os/motd/tips/25-bazzite-deck.md b/system_files/deck/shared/usr/share/ublue-os/motd/tips/25-bazzite-deck.md new file mode 100644 index 00000000..2004cc4b --- /dev/null +++ b/system_files/deck/shared/usr/share/ublue-os/motd/tips/25-bazzite-deck.md @@ -0,0 +1,3 @@ +*Using a handheld other than the Steam Deck?* Be sure to follow our [alternative handheld documentation](https://github.com/ublue-os/bazzite#alternative-handhelds). +*Want to install Decky Loader?* There's a `ujust` command for that! `ujust get-decky` +The updater built into Steam's Game mode has been modified to update Bazzite, Flatpaks, and Distrobox containers. \ No newline at end of file diff --git a/system_files/desktop/kinoite/usr/share/ublue-os/motd/tips/30-kde.md b/system_files/desktop/kinoite/usr/share/ublue-os/motd/tips/30-kde.md new file mode 100644 index 00000000..2b8fbc50 --- /dev/null +++ b/system_files/desktop/kinoite/usr/share/ublue-os/motd/tips/30-kde.md @@ -0,0 +1,3 @@ +*Want an animated wallpaper?* The Wallpaper Engine plugin for KDE is pre-installed - [View the usage guide](https://github.com/catsout/wallpaper-engine-kde-plugin#usage) +*Rather use KDE Konsole?* You can restore the application icon for it with `ujust restore-original-terminal`. Be sure to also change the default terminal in System Settings. +ProtonUp-Qt can be used to install and update custom versions of Proton. We recommend Proton-GE for Steam games and Wine-GE for all other use cases. \ No newline at end of file diff --git a/system_files/desktop/shared/usr/share/ublue-os/motd/tips/10-desktop-tips.md b/system_files/desktop/shared/usr/share/ublue-os/motd/tips/10-desktop-tips.md deleted file mode 100644 index 5cf34577..00000000 --- a/system_files/desktop/shared/usr/share/ublue-os/motd/tips/10-desktop-tips.md +++ /dev/null @@ -1,5 +0,0 @@ -It is **always** better to install packages with Distrobox than to layer them with rpm-ostree. `ujust distrobox` makes it easy! -Packages installed in Distrobox can be exported to appear like any other application - [View documentation](https://github.com/89luca89/distrobox/blob/main/docs/usage/distrobox-export.md). -Update break something? You can roll back and pin the previous release or rebase by build date - [View our guide](https://universal-blue.discourse.group/docs?topic=513). -Installing a non-Steam Windows game? Lutris is pre-installed for better handling of wine prefixes. -BTRFS is used by default for external drives, and we recommend that or EXT4 over NTFS - [More info here](https://github.com/ValveSoftware/Proton/wiki/Using-a-NTFS-disk-with-Linux-and-Windows). \ No newline at end of file diff --git a/system_files/desktop/shared/usr/share/ublue-os/motd/tips/10-ublue.md b/system_files/desktop/shared/usr/share/ublue-os/motd/tips/10-ublue.md new file mode 100644 index 00000000..9a2ba657 --- /dev/null +++ b/system_files/desktop/shared/usr/share/ublue-os/motd/tips/10-ublue.md @@ -0,0 +1,3 @@ +It is **always** better to install packages with Distrobox than to layer them with rpm-ostree. `ujust distrobox` makes it easy! +Packages installed in Distrobox can be exported to appear like any other application - [View documentation](https://github.com/89luca89/distrobox/blob/main/docs/usage/distrobox-export.md). +*Update break something?* You can roll back and pin the previous release or rebase by build date - [View our guide](https://universal-blue.discourse.group/docs?topic=513). \ No newline at end of file diff --git a/system_files/desktop/shared/usr/share/ublue-os/motd/tips/20-bazzite.md b/system_files/desktop/shared/usr/share/ublue-os/motd/tips/20-bazzite.md new file mode 100644 index 00000000..04ddd0bd --- /dev/null +++ b/system_files/desktop/shared/usr/share/ublue-os/motd/tips/20-bazzite.md @@ -0,0 +1,7 @@ +*Installing a Windows game that isn't on Steam?* Lutris is pre-installed and recommended for better handling of wine prefixes. +BTRFS is used by default for external drives, and we recommend that or EXT4 over NTFS - [More info](https://github.com/ValveSoftware/Proton/wiki/Using-a-NTFS-disk-with-Linux-and-Windows). +*No Flatpak or distro packaging available?* The Gear Lever app is included to make managing and integrating AppImages easy! +Want to control your device from your phone? The KDE Connect app functions with all Bazzite images - [More info](https://kdeconnect.kde.org/) +*Trying to use Feral Gamemode?* System76-Scheduler in Bazzite replaces it, offering automatic nice value adjustments for applications based on the currently focused one and built-in rules. +Discover Overlay is preinstalled, allowing Discord to overlay your games during voice chats - [More info](https://trigg.github.io/Discover/) +*Looking to setup Waydroid?* - [View our documentation](https://universal-blue.discourse.group/docs?topic=32) \ No newline at end of file diff --git a/system_files/desktop/silverblue/usr/share/ublue-os/motd/tips/30-gnome.md b/system_files/desktop/silverblue/usr/share/ublue-os/motd/tips/30-gnome.md new file mode 100644 index 00000000..a00f980f --- /dev/null +++ b/system_files/desktop/silverblue/usr/share/ublue-os/motd/tips/30-gnome.md @@ -0,0 +1,3 @@ +*Looking for some nostalgia?* Enable `Compiz windows effect` from the Extension Manager. +*Missing the top left hot corner?* Apply pressure to the bottom edge of your screen with your mouse. You can also re-enable the hot corner from settings if desired. +ProtonPlus can be used to install and update custom versions of Proton. We recommend Proton-GE for Steam games and Wine-GE for all other use cases. \ No newline at end of file diff --git a/system_files/nvidia/shared/usr/share/ublue-os/motd/tips/100-nvidia.md b/system_files/nvidia/shared/usr/share/ublue-os/motd/tips/100-nvidia.md new file mode 100644 index 00000000..db08a90e --- /dev/null +++ b/system_files/nvidia/shared/usr/share/ublue-os/motd/tips/100-nvidia.md @@ -0,0 +1 @@ +*Using an Nvidia GPU and experiencing flickering?* Switch to X11 from your login screen *(Can't wait for NVK)*. \ No newline at end of file diff --git a/system_files/nvidia/shared/usr/share/ublue-os/motd/tips/30-nvidia-tips.md b/system_files/nvidia/shared/usr/share/ublue-os/motd/tips/30-nvidia-tips.md deleted file mode 100644 index 80a1d2da..00000000 --- a/system_files/nvidia/shared/usr/share/ublue-os/motd/tips/30-nvidia-tips.md +++ /dev/null @@ -1 +0,0 @@ -Using a Nvidia GPU and getting flickering issues? Switch to X11 from your login screen *(Can't wait for NVK)*. \ No newline at end of file From c584eb7bf6887e09cf1b6a5ce91308b70631992f Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Mon, 29 Jan 2024 01:01:15 -0800 Subject: [PATCH 3/3] chore: Minor adjustments to WineGE/ProtonGE section --- .../desktop/kinoite/usr/share/ublue-os/motd/tips/30-kde.md | 2 +- .../desktop/silverblue/usr/share/ublue-os/motd/tips/30-gnome.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system_files/desktop/kinoite/usr/share/ublue-os/motd/tips/30-kde.md b/system_files/desktop/kinoite/usr/share/ublue-os/motd/tips/30-kde.md index 2b8fbc50..3bdadad0 100644 --- a/system_files/desktop/kinoite/usr/share/ublue-os/motd/tips/30-kde.md +++ b/system_files/desktop/kinoite/usr/share/ublue-os/motd/tips/30-kde.md @@ -1,3 +1,3 @@ *Want an animated wallpaper?* The Wallpaper Engine plugin for KDE is pre-installed - [View the usage guide](https://github.com/catsout/wallpaper-engine-kde-plugin#usage) *Rather use KDE Konsole?* You can restore the application icon for it with `ujust restore-original-terminal`. Be sure to also change the default terminal in System Settings. -ProtonUp-Qt can be used to install and update custom versions of Proton. We recommend Proton-GE for Steam games and Wine-GE for all other use cases. \ No newline at end of file +ProtonUp-Qt can be used to install and update custom versions of Proton. We recommend Proton-GE for problematic Steam games and Wine-GE for all other use cases outside of Steam. \ No newline at end of file diff --git a/system_files/desktop/silverblue/usr/share/ublue-os/motd/tips/30-gnome.md b/system_files/desktop/silverblue/usr/share/ublue-os/motd/tips/30-gnome.md index a00f980f..192aedc2 100644 --- a/system_files/desktop/silverblue/usr/share/ublue-os/motd/tips/30-gnome.md +++ b/system_files/desktop/silverblue/usr/share/ublue-os/motd/tips/30-gnome.md @@ -1,3 +1,3 @@ *Looking for some nostalgia?* Enable `Compiz windows effect` from the Extension Manager. *Missing the top left hot corner?* Apply pressure to the bottom edge of your screen with your mouse. You can also re-enable the hot corner from settings if desired. -ProtonPlus can be used to install and update custom versions of Proton. We recommend Proton-GE for Steam games and Wine-GE for all other use cases. \ No newline at end of file +ProtonPlus can be used to install and update custom versions of Proton. We recommend Proton-GE for problematic Steam games and Wine-GE for all other use cases outside of Steam. \ No newline at end of file