diff options
| author | tranch <tranch.xiao@gmail.com> | 2026-08-28 08:57:25 +0800 |
|---|---|---|
| committer | tranch <tranch.xiao@gmail.com> | 2026-08-28 08:57:35 +0800 |
| commit | 7889a92c2eea98189330ad1fbfbef4c33a7e3071 (patch) | |
| tree | b956f6670a15ab1730588b24567502ff82e64213 /system_files | |
| parent | 258e7422812b1a18f75c5a48030c64ccb16766ba (diff) | |
| download | AeroCore-OS-7889a92c2eea98189330ad1fbfbef4c33a7e3071.tar.gz AeroCore-OS-7889a92c2eea98189330ad1fbfbef4c33a7e3071.zip | |
Move branding migration into user setup
Diffstat (limited to 'system_files')
3 files changed, 22 insertions, 33 deletions
diff --git a/system_files/usr/lib/systemd/system/aerocore-desktop-branding.service b/system_files/usr/lib/systemd/system/aerocore-desktop-branding.service deleted file mode 100644 index fee52f1..0000000 --- a/system_files/usr/lib/systemd/system/aerocore-desktop-branding.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Apply AeroCore desktop branding migrations -After=local-fs.target -Before=display-manager.service - -[Service] -Type=oneshot -ExecStart=/usr/libexec/aerocore-desktop-branding - -[Install] -WantedBy=graphical.target diff --git a/system_files/usr/libexec/aerocore-desktop-branding b/system_files/usr/libexec/aerocore-desktop-branding index 8b8b9e0..84902eb 100755 --- a/system_files/usr/libexec/aerocore-desktop-branding +++ b/system_files/usr/libexec/aerocore-desktop-branding @@ -2,27 +2,15 @@ set -euo pipefail -# The optional prefix makes the migration testable without touching the host. -root_prefix="${AEROCORE_DESKTOP_BRANDING_ROOT:-}" -about_source="${root_prefix}/usr/share/aerocore/desktop-branding/kcm-about-distrorc" -about_target="${root_prefix}/etc/xdg/kcm-about-distrorc" +# Called from Bazzite's user-level setup. The setup's version files provide +# the once-per-image-version guard; this helper only touches the current user. +plasma_config="${HOME}/.config/plasma-org.kde.plasma.desktop-appletsrc" -# Existing installations can retain Bazzite's old /etc copy across deployment -# updates. Only replace that known upstream default; administrator changes win. -if [[ -f "${about_source}" ]] && - { [[ ! -f "${about_target}" ]] || grep -Fxq 'Name=Bazzite' "${about_target}"; }; then - install -Dm0644 "${about_source}" "${about_target}" +if [[ -f "${plasma_config}" ]] && grep -Fxq 'icon=distributor-logo-steamdeck' "${plasma_config}"; then + updated_config="$(mktemp "${plasma_config}.XXXXXX")" + trap 'rm -f -- "${updated_config}"' EXIT + sed 's/^icon=distributor-logo-steamdeck$/icon=aerocore-logo/' \ + "${plasma_config}" > "${updated_config}" + mv -- "${updated_config}" "${plasma_config}" + trap - EXIT fi - -# Deck's stock look-and-feel stores this value in each user's Plasma config. -# Migrate only the unmodified upstream value so users can still choose an icon. -shopt -s nullglob -for plasma_config in "${root_prefix}"/var/home/*/.config/plasma-org.kde.plasma.desktop-appletsrc \ - "${root_prefix}"/home/*/.config/plasma-org.kde.plasma.desktop-appletsrc; do - if grep -Fxq 'icon=distributor-logo-steamdeck' "${plasma_config}"; then - updated_config="$(mktemp "${plasma_config}.XXXXXX")" - sed 's/^icon=distributor-logo-steamdeck$/icon=aerocore-logo/' "${plasma_config}" > "${updated_config}" - cat "${updated_config}" > "${plasma_config}" - rm -f "${updated_config}" - fi -done diff --git a/system_files/usr/libexec/aerocore-desktop-branding-privileged b/system_files/usr/libexec/aerocore-desktop-branding-privileged new file mode 100755 index 0000000..318a64a --- /dev/null +++ b/system_files/usr/libexec/aerocore-desktop-branding-privileged @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -euo pipefail + +about_source=/usr/share/aerocore/desktop-branding/kcm-about-distrorc +about_target=/etc/xdg/kcm-about-distrorc + +# Only replace the known upstream default. Administrator changes win. +if [[ -f "${about_source}" ]] && + { [[ ! -f "${about_target}" ]] || grep -Fxq 'Name=Bazzite' "${about_target}"; }; then + install -Dm0644 "${about_source}" "${about_target}" +fi |
