diff --git a/README.md b/README.md index 43183f1..f370412 100644 --- a/README.md +++ b/README.md @@ -105,8 +105,15 @@ rpm-ostree rebase ostree-unverified-registry:YOUR-FORGEJO-DOMAIN/YOUR-USERNAME/k ## Customizing KAMOS -- **Add packages baked into the OS:** edit `build_files/build.sh` - (`dnf5 -y install `), push — CI rebuilds the image. +- **Add/remove system packages:** edit [`build_files/packages.list`](build_files/packages.list) + — one package name per line, `#` for comments. Push, CI rebuilds. +- **Add/remove default apps (Flatpaks):** edit + [`system_files/usr/share/kamos/flatpaks.list`](system_files/usr/share/kamos/flatpaks.list) + with Flathub app IDs — installed automatically on each machine's first boot. +- **Wallpaper/logo:** replace + `system_files/usr/share/backgrounds/kamos/kamos-default.png` and + `system_files/usr/share/pixmaps/kamos-logo.png`. The build stamps the + wallpaper over all stock desktop wallpapers. - **Add config files:** drop them under `system_files/` mirroring the target path (e.g. `system_files/etc/foo.conf` → `/etc/foo.conf`). - **Apps like Heroic, Lutris, Discord, OBS:** install as Flatpaks after boot diff --git a/build_files/build.sh b/build_files/build.sh index 33a915a..09bd508 100644 --- a/build_files/build.sh +++ b/build_files/build.sh @@ -11,23 +11,37 @@ sed -i 's/^NAME=.*/NAME="KAMOS"/' /usr/lib/os-release sed -i 's/^PRETTY_NAME=.*/PRETTY_NAME="KAMOS (Gaming Edition)"/' /usr/lib/os-release ### --------------------------------------------------------------- -### 2. Extra packages layered on top of Bazzite -### Bazzite stable already ships: Steam, Gamescope, Proton (via -### Steam), MangoHud, vkBasalt, gamemode, Lutris deps, Waydroid, -### Distrobox, KDE Plasma, HDR/VRR support, fsync kernel. -### Add anything extra you want baked into the OS here. +### 2. System packages from build_files/packages.list ### --------------------------------------------------------------- -dnf5 -y install \ - btop \ - fastfetch - -# Examples (uncomment to include): -# dnf5 -y install openrgb # RGB peripheral control -# dnf5 -y install corectrl # AMD GPU/CPU tuning UI -# dnf5 -y install input-remapper # remap controller/keyboard +PKGS=$(sed -e 's/#.*//' -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' \ + /tmp/build_files/packages.list | grep -v '^$' || true) +if [ -n "$PKGS" ]; then + # shellcheck disable=SC2086 + dnf5 -y install $PKGS +fi ### --------------------------------------------------------------- -### 3. System defaults +### 3. Wallpaper branding: replace every stock wallpaper image with +### the KAMOS one so the desktop defaults to KAMOS artwork +### --------------------------------------------------------------- +WALL=/usr/share/backgrounds/kamos/kamos-default.png +if [ -f "$WALL" ]; then + find /usr/share/wallpapers /usr/share/backgrounds \ + -type f \( -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' \) \ + ! -path '*/kamos/*' -print0 2>/dev/null | + while IFS= read -r -d '' img; do + cp -f "$WALL" "$img" + done +fi + +### --------------------------------------------------------------- +### 4. First-boot Flatpak apps (list: /usr/share/kamos/flatpaks.list) +### --------------------------------------------------------------- +chmod +x /usr/libexec/kamos-install-flatpaks +systemctl enable kamos-flatpaks.service + +### --------------------------------------------------------------- +### 5. System defaults ### --------------------------------------------------------------- # Enable weekly automatic OS updates (staged, applied on reboot) systemctl enable rpm-ostreed-automatic.timer || true diff --git a/build_files/packages.list b/build_files/packages.list new file mode 100644 index 0000000..94fa93c --- /dev/null +++ b/build_files/packages.list @@ -0,0 +1,11 @@ +# System packages baked into the KAMOS image (one per line). +# Add a package name to include it in the OS; delete a line to remove it. +# Lines starting with # are ignored. Changes take effect on the next build. + +btop +fastfetch + +# --- popular extras (remove the # to enable) --- +# openrgb # RGB peripheral control +# corectrl # AMD GPU/CPU tuning UI +# input-remapper # remap controller/keyboard buttons diff --git a/system_files/usr/lib/systemd/system/kamos-flatpaks.service b/system_files/usr/lib/systemd/system/kamos-flatpaks.service new file mode 100644 index 0000000..28bb1a7 --- /dev/null +++ b/system_files/usr/lib/systemd/system/kamos-flatpaks.service @@ -0,0 +1,13 @@ +[Unit] +Description=Install KAMOS default Flatpak apps (first boot) +Wants=network-online.target +After=network-online.target +ConditionPathExists=!/var/lib/kamos-flatpaks-done + +[Service] +Type=oneshot +ExecStart=/usr/libexec/kamos-install-flatpaks +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/system_files/usr/libexec/kamos-install-flatpaks b/system_files/usr/libexec/kamos-install-flatpaks new file mode 100644 index 0000000..0f3feb6 --- /dev/null +++ b/system_files/usr/libexec/kamos-install-flatpaks @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# Installs the default KAMOS Flatpak apps on first boot (runs once). +set -u + +LIST=/usr/share/kamos/flatpaks.list +STAMP=/var/lib/kamos-flatpaks-done + +[ -f "$STAMP" ] && exit 0 + +flatpak remote-add --if-not-exists --system flathub \ + https://dl.flathub.org/repo/flathub.flatpakrepo || true + +ok=1 +while IFS= read -r app; do + case "$app" in ''|\#*) continue ;; esac + app="${app%%#*}"; app="$(echo "$app" | xargs)" + [ -z "$app" ] && continue + flatpak install --system --noninteractive --or-update flathub "$app" || ok=0 +done < "$LIST" + +# Only mark done when everything succeeded, so it retries next boot otherwise +[ "$ok" = 1 ] && touch "$STAMP" +exit 0 diff --git a/system_files/usr/share/backgrounds/kamos/kamos-default.png b/system_files/usr/share/backgrounds/kamos/kamos-default.png new file mode 100644 index 0000000..7b4db0d Binary files /dev/null and b/system_files/usr/share/backgrounds/kamos/kamos-default.png differ diff --git a/system_files/usr/share/kamos/flatpaks.list b/system_files/usr/share/kamos/flatpaks.list new file mode 100644 index 0000000..ad119cb --- /dev/null +++ b/system_files/usr/share/kamos/flatpaks.list @@ -0,0 +1,13 @@ +# Flatpak apps KAMOS installs automatically on first boot (one per line). +# Add a Flathub app ID to include it; delete a line to remove it from new +# installs. Find IDs at https://flathub.org (page URL ends with the ID). +# Lines starting with # are ignored. + +com.heroicgameslauncher.hgl +net.davidotek.pupgui2 + +# --- popular extras (remove the # to enable) --- +# com.discordapp.Discord +# com.obsproject.Studio +# org.videolan.VLC +# com.spotify.Client diff --git a/system_files/usr/share/pixmaps/kamos-logo.png b/system_files/usr/share/pixmaps/kamos-logo.png new file mode 100644 index 0000000..08341bf Binary files /dev/null and b/system_files/usr/share/pixmaps/kamos-logo.png differ