From a42f7292d6b42047ad79c7c7362b7c01f8a48834 Mon Sep 17 00:00:00 2001 From: humocs-man <251756307+humocs-man@users.noreply.github.com> Date: Sun, 8 Mar 2026 14:53:38 +0100 Subject: [PATCH] changed philosophy from taking everything from ublue to using it as base solely --- Containerfile | 22 +- build/10-build.sh | 40 --- files/usr/libexec/cosmic/firstboot-setup.sh | 299 ++++++++++++++++++ .../applications/cosmic-firstboot.desktop | 8 + 4 files changed, 308 insertions(+), 61 deletions(-) create mode 100755 files/usr/libexec/cosmic/firstboot-setup.sh create mode 100644 files/usr/share/applications/cosmic-firstboot.desktop diff --git a/Containerfile b/Containerfile index f4d56d7..ef871cb 100644 --- a/Containerfile +++ b/Containerfile @@ -23,8 +23,6 @@ # # 1. Context Stage (ctx) - Combines resources from: # - Local build scripts and custom files -# - @projectbluefin/common - Desktop configuration shared with Aurora -# - @ublue-os/brew - Homebrew integration # # 2. Base Image Options: # - `ghcr.io/ublue-os/silverblue-main:latest` (Fedora and GNOME) @@ -39,13 +37,6 @@ FROM scratch AS ctx COPY build /build COPY custom /custom -# Copy from OCI containers to distinct subdirectories to avoid conflicts -# Note: Renovate can automatically update these :latest tags to SHA-256 digests for reproducibility -COPY --from=ghcr.io/projectbluefin/common:latest /system_files /oci/common -COPY --from=ghcr.io/ublue-os/brew:latest /system_files /oci/brew - -# Base Image - GNOME included -#FROM ghcr.io/ublue-os/silverblue-main:latest ## Alternative base images, no desktop included (uncomment to use): FROM ghcr.io/ublue-os/base-main:latest @@ -65,16 +56,6 @@ FROM ghcr.io/ublue-os/base-main:latest # RUN rm /opt && mkdir /opt -### MODIFICATIONS -## Make modifications desired in your image and install packages by modifying the build scripts. -## The following RUN directive mounts the ctx stage which includes: -## - Local build scripts from /build -## - Local custom files from /custom -## - Files from @projectbluefin/common at /oci/common -## - Files from @projectbluefin/branding at /oci/branding -## - Files from @ublue-os/artwork at /oci/artwork -## - Files from @ublue-os/brew at /oci/brew -## Scripts are run in numerical order (10-build.sh, 20-example.sh, etc.) RUN --mount=type=bind,from=ctx,source=/,target=/ctx \ --mount=type=cache,dst=/var/cache \ @@ -83,8 +64,7 @@ RUN --mount=type=bind,from=ctx,source=/,target=/ctx \ /ctx/build/10-build.sh COPY files/ / -RUN systemctl preset-all - + ### LINTING ## Verify final image and contents are correct. RUN bootc container lint diff --git a/build/10-build.sh b/build/10-build.sh index 259cf74..944a921 100755 --- a/build/10-build.sh +++ b/build/10-build.sh @@ -13,24 +13,6 @@ source /ctx/build/copr-helpers.sh # Enable nullglob for all glob operations to prevent failures on empty matches shopt -s nullglob -echo "::group:: Apply Bluefin common system files" -cp -a /ctx/oci/common/. / -echo "::endgroup::" - -echo "::group:: Remove Bluefin GNOME branding" -rm -rf /usr/share/backgrounds/bluefin -rm -rf /usr/share/gnome-shell -rm -rf /usr/share/themes/Bluefin* -rm -rf /usr/share/icons/Bluefin* -rm -rf /usr/share/ublue-os/gnome -rm -f /usr/share/glib-2.0/schemas/*bluefin*.gschema.override -echo "::endgroup::" - -echo "::group:: Apply Brew integration" -# Bringt Brew-User, PATH, systemd-Units, Brew-Bundle-Mechanik -cp -a /ctx/oci/brew/. / -echo "::endgroup::" - echo "::group:: Install Packages" # flatpak und just sind im base-main vorhanden, aber wir ergänzen deine Tools dnf5 install -y \ @@ -49,28 +31,6 @@ dnf5 install -y \ usbredir echo "::endgroup::" -echo "::group:: Remove Firefox Systempackage" -dnf5 remove -y \ - firefox \ - firefox-langpacks\* \ - htop \ - nvtop -echo "::endgroup::" - -echo "::group:: Copy Custom Files" -# Brewfiles → werden durch Brew-Bundle.service verarbeitet -mkdir -p /usr/share/ublue-os/homebrew/ -cp /ctx/custom/brew/*.Brewfile /usr/share/ublue-os/homebrew/ - -# Just-Rezepte → werden durch just automatisch gefunden -find /ctx/custom/ujust -iname '*.just' -exec printf "\n\n" \; -exec cat {} \; \ - >> /usr/share/ublue-os/just/60-custom.just - -# Flatpak-Preinstall-Skripte → werden durch flatpak-preinstall.service ausgeführt -mkdir -p /etc/flatpak/preinstall.d/ -cp /ctx/custom/flatpaks/*.preinstall /usr/share/flatpak/preinstall.d/ -echo "::endgroup::" - echo "::group:: Installing COSMIC" copr_install_isolated "ryanabx/cosmic-epoch" \ cosmic-desktop diff --git a/files/usr/libexec/cosmic/firstboot-setup.sh b/files/usr/libexec/cosmic/firstboot-setup.sh new file mode 100755 index 0000000..62ea639 --- /dev/null +++ b/files/usr/libexec/cosmic/firstboot-setup.sh @@ -0,0 +1,299 @@ +#!/usr/bin/env bash +set -euo pipefail + +DIALOG=dialog +HEIGHT=20 +WIDTH=74 +LOG="/var/log/firstboot-setup.log" +WIZARD_DONE="$HOME/.config/cosmic/firstboot.done" + +# ---------------------------- +# Run only once +# ---------------------------- +if [[ -f "$WIZARD_DONE" ]]; then + exit 0 +fi + +exec > >(tee -a "$LOG") 2>&1 + +abort() { + clear + echo "Setup abgebrochen." + exit 1 +} + +ensure_flathub() { + flatpak remote-list --columns=name 2>/dev/null | grep -qx flathub || \ + flatpak remote-add --if-not-exists flathub \ + https://dl.flathub.org/repo/flathub.flatpakrepo +} + +install_brew_and_setup_path() { + if ! command -v brew >/dev/null 2>&1; then + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + fi + + local BREW_PREFIX="/home/linuxbrew/.linuxbrew" + local BREW_BIN="$BREW_PREFIX/bin/brew" + [[ -x "$BREW_BIN" ]] || BREW_BIN="$(command -v brew)" + + eval "$("$BREW_BIN" shellenv)" + + for rc in "$HOME/.bashrc" "$HOME/.zshrc"; do + [[ -f "$rc" ]] || continue + grep -q 'brew shellenv' "$rc" || { + echo "" >> "$rc" + echo "# Homebrew" >> "$rc" + echo "eval \"\$($BREW_BIN shellenv)\"" >> "$rc" + } + done +} + +# ---------------------------- +# Welcome +# ---------------------------- +$DIALOG --title "Willkommen bei COSMIC" --msgbox \ +"Dieser Assistent erleichtert dir den Einstieg, +indem er eine Auswahl gängiger Anwendungen anbietet. + +Wichtig: +• Alle hier angebotenen Anwendungen können + jederzeit auch über den COSMIC‑Shop installiert + oder entfernt werden. +• Der Wizard ist optional und kann komplett + übersprungen werden. +• Er deckt nur eine Auswahl verbreiteter + Anwendungen ab – nicht alles. + +Nach Abschluss wird dieser Assistent +nicht erneut angezeigt." \ +$HEIGHT $WIDTH || abort + +# ---------------------------- +# Selections +# ---------------------------- +BROWSERS=() +OFFICE=() +GRAPHICS=() +MEDIA=() +AV=() +GAMES=() +MAIL=() +DEV=() +SYSTEM=() + +# ---------------------------- +# Browser +# ---------------------------- +BROWSERS=($($DIALOG --title "Browser" --checklist \ +"Webbrowser werden für viele Aufgaben benötigt +(z. B. Dokumentation, Web‑Apps, Login‑Flows)." \ +$HEIGHT $WIDTH 5 \ +"firefox" "Mozilla Firefox (empfohlen)" ON \ +"chromium" "Chromium (Open‑Source Basis)" OFF \ +"brave" "Brave (datenschutzorientiert)" OFF \ +2>&1 >/dev/tty)) || abort + +# ---------------------------- +# Office +# ---------------------------- +OFFICE=($($DIALOG --title "Office & Dokumente" --checklist \ +"Anwendungen für Dokumente, PDFs und Büroarbeit:" \ +$HEIGHT $WIDTH 7 \ +"libreoffice" "LibreOffice (Office‑Suite)" ON \ +"onlyoffice" "OnlyOffice (MS‑Office‑ähnlich)" OFF \ +"collabora" "Collabora Office (LibreOffice‑basiert)" OFF \ +"papers" "Papers (PDF‑Viewer)" ON \ +"simplescan" "Simple Scan (Scanner‑Anwendung)" OFF \ +2>&1 >/dev/tty)) || abort + +# ---------------------------- +# Graphics +# ---------------------------- +GRAPHICS=($($DIALOG --title "Grafik & Kreativ" --checklist \ +"Bildbearbeitung, Illustration und Vektorgrafik:" \ +$HEIGHT $WIDTH 5 \ +"gimp" "GIMP (Bildbearbeitung)" OFF \ +"krita" "Krita (Zeichnen & Illustration)" OFF \ +"inkscape" "Inkscape (Vektorgrafiken & SVG)" OFF \ +2>&1 >/dev/tty)) || abort + +# ---------------------------- +# Media +# ---------------------------- +MEDIA=($($DIALOG --title "Medien & Unterhaltung" --checklist \ +"Wiedergabe von Audio und Video:" \ +$HEIGHT $WIDTH 4 \ +"vlc" "VLC Media Player" ON \ +"spotify" "Spotify Client" OFF \ +2>&1 >/dev/tty)) || abort + +# ---------------------------- +# Audio / Video Editing +# ---------------------------- +AV=($($DIALOG --title "Audio & Video‑Bearbeitung" --checklist \ +"Erstellung und Bearbeitung von Audio‑ und Videoinhalten:" \ +$HEIGHT $WIDTH 6 \ +"shotcut" "Shotcut (einfacher Video‑Editor)" OFF \ +"kdenlive" "Kdenlive (leistungsfähiger Video‑Editor)" OFF \ +"audacity" "Audacity (Audio‑Bearbeitung)" OFF \ +"ardour" "Ardour (professionelle Audio‑Produktion)" OFF \ +2>&1 >/dev/tty)) || abort + +# ---------------------------- +# Games +# ---------------------------- +GAMES=($($DIALOG --title "Spiele" --checklist \ +"Plattformen für PC‑Spiele. + +Hinweis: +• Für Steam und Lutris ist ein Benutzerkonto erforderlich. +• Es werden keine Spiele automatisch installiert." \ +$HEIGHT $WIDTH 4 \ +"steam" "Steam (Valve‑Plattform)" OFF \ +"lutris" "Lutris (Multi‑Plattform‑Launcher)" OFF \ +2>&1 >/dev/tty)) || abort + +# ---------------------------- +# Mail +# ---------------------------- +MAIL=($($DIALOG --title "E‑Mail" --checklist \ +"Desktop‑E‑Mail‑Programme für IMAP/POP‑Konten:" \ +$HEIGHT $WIDTH 5 \ +"thunderbird" "Thunderbird (vollständiger Standard‑Client)" ON \ +"geary" "Geary (einfacher, moderner Mail‑Client)" OFF \ +"evolution" "Evolution (Business‑ & Exchange‑Client)" OFF \ +2>&1 >/dev/tty)) || abort + +# ---------------------------- +# Development +# ---------------------------- +DEV=($($DIALOG --title "Entwicklung" --checklist \ +"Werkzeuge für Software‑Entwicklung:" \ +$HEIGHT $WIDTH 4 \ +"vscode" "Visual Studio Code" OFF \ +2>&1 >/dev/tty)) || abort + +# ---------------------------- +# System Tools +# ---------------------------- +SYSTEM=($($DIALOG --title "System‑Werkzeuge" --checklist \ +"Hilfsprogramme für System‑Konfiguration:" \ +$HEIGHT $WIDTH 4 \ +"flatseal" "Flatseal (Flatpak‑Rechte verwalten)" OFF \ +2>&1 >/dev/tty)) || abort + +# ---------------------------- +# Homebrew +# ---------------------------- +USE_BREW=$($DIALOG --title "Homebrew (optional)" --yesno \ +"Homebrew ist ein zusätzlicher Paketmanager +für Entwickler‑ und CLI‑Werkzeuge. + +• Installation im Benutzerverzeichnis +• Keine Änderung am Basissystem +• Komplett optional" \ +$HEIGHT $WIDTH && echo yes || echo no) + +# ---------------------------- +# Summary +# ---------------------------- +SUMMARY="Browser: ${BROWSERS[*]:-keine} +Office: ${OFFICE[*]:-keine} +Grafik: ${GRAPHICS[*]:-keine} +Medien: ${MEDIA[*]:-keine} +Audio/Video: ${AV[*]:-keine} +Spiele: ${GAMES[*]:-keine} +E‑Mail: ${MAIL[*]:-keine} +Entwicklung: ${DEV[*]:-keine} +System: ${SYSTEM[*]:-keine} + +Homebrew: $USE_BREW" + +$DIALOG --title "Zusammenfassung" --yesno \ +"Bitte bestätige die Installation:\n\n$SUMMARY" \ +$HEIGHT $WIDTH || abort + +# ---------------------------- +# Installation +# ---------------------------- +ensure_flathub + +( + echo "10"; echo "# Installiere Browser..." + for b in "${BROWSERS[@]}"; do + case "$b" in + firefox) flatpak install -y flathub org.mozilla.firefox ;; + chromium) flatpak install -y flathub org.chromium.Chromium ;; + brave) flatpak install -y flathub com.brave.Browser ;; + esac + done + + echo "25"; echo "# Installiere Office..." + [[ " ${OFFICE[*]} " == *" libreoffice "* ]] && flatpak install -y flathub org.libreoffice.LibreOffice + [[ " ${OFFICE[*]} " == *" onlyoffice "* ]] && flatpak install -y flathub org.onlyoffice.desktopeditors + [[ " ${OFFICE[*]} " == *" collabora "* ]] && flatpak install -y flathub com.collabora.CollaboraOffice + [[ " ${OFFICE[*]} " == *" papers "* ]] && flatpak install -y flathub org.gnome.Papers + [[ " ${OFFICE[*]} " == *" simplescan "* ]] && flatpak install -y flathub org.gnome.SimpleScan + + echo "40"; echo "# Installiere Grafik‑Tools..." + [[ " ${GRAPHICS[*]} " == *" gimp "* ]] && flatpak install -y flathub org.gimp.GIMP + [[ " ${GRAPHICS[*]} " == *" krita "* ]] && flatpak install -y flathub org.kde.krita + [[ " ${GRAPHICS[*]} " == *" inkscape "* ]] && flatpak install -y flathub org.inkscape.Inkscape + + echo "55"; echo "# Installiere Medien..." + [[ " ${MEDIA[*]} " == *" vlc "* ]] && flatpak install -y flathub org.videolan.VLC + [[ " ${MEDIA[*]} " == *" spotify "* ]] && flatpak install -y flathub com.spotify.Client + + echo "70"; echo "# Installiere Audio/Video‑Tools..." + [[ " ${AV[*]} " == *" shotcut "* ]] && flatpak install -y flathub org.shotcut.Shotcut + [[ " ${AV[*]} " == *" kdenlive "* ]] && flatpak install -y flathub org.kde.kdenlive + [[ " ${AV[*]} " == *" audacity "* ]] && flatpak install -y flathub org.audacityteam.Audacity + [[ " ${AV[*]} " == *" ardour "* ]] && flatpak install -y flathub org.ardour.Ardour + + echo "85"; echo "# Installiere Spiele‑Plattformen..." + [[ " ${GAMES[*]} " == *" steam "* ]] && flatpak install -y flathub com.valvesoftware.Steam + [[ " ${GAMES[*]} " == *" lutris "* ]] && flatpak install -y flathub net.lutris.Lutris + + echo "90"; echo "# Installiere E‑Mail‑Clients..." + [[ " ${MAIL[*]} " == *" thunderbird "* ]] && flatpak install -y flathub org.mozilla.Thunderbird + [[ " ${MAIL[*]} " == *" geary "* ]] && flatpak install -y flathub org.gnome.Geary + [[ " ${MAIL[*]} " == *" evolution "* ]] && flatpak install -y flathub org.gnome.Evolution + + echo "95"; echo "# Installiere Entwicklung..." + [[ " ${DEV[*]} " == *" vscode "* ]] && flatpak install -y flathub com.visualstudio.code + + echo "97"; echo "# Installiere System‑Tools..." + [[ " ${SYSTEM[*]} " == *" flatseal "* ]] && flatpak install -y flathub com.github.tchx84.Flatseal + + echo "98"; echo "# Homebrew..." + [[ "$USE_BREW" == yes ]] && install_brew_and_setup_path + + echo "100"; echo "# Fertig." +) | $DIALOG --title "Installation läuft" --gauge \ +"Bitte warten..." \ +$HEIGHT $WIDTH 0 + +# ---------------------------- +# Mark wizard as done +# ---------------------------- +mkdir -p "$(dirname "$WIZARD_DONE")" +touch "$WIZARD_DONE" + +$DIALOG --title "Fertig" --msgbox \ +"Die Einrichtung ist abgeschlossen. + +Weitere Anwendungen kannst du jederzeit +über den COSMIC‑Shop installieren. + +Updates: +• Installierte Anwendungen werden über den COSMIC‑Shop aktualisiert. +• Homebrew‑Pakete können mit folgendem Befehl aktualisiert werden: + + >>>>> brew update && brew upgrade <<<<< + +Der Setup‑Wizard wird nicht erneut gestartet." \ +$HEIGHT $WIDTH + +clear + diff --git a/files/usr/share/applications/cosmic-firstboot.desktop b/files/usr/share/applications/cosmic-firstboot.desktop new file mode 100644 index 0000000..909ce1c --- /dev/null +++ b/files/usr/share/applications/cosmic-firstboot.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=COSMIC First Boot Setup +Exec=/usr/libexec/cosmic/firstboot-setup.sh +OnlyShowIn=COSMIC; +X-GNOME-Autostart-enabled=true +NoDisplay=true +