Add plymouth and sddm branding packages with stand-in art

e74691a · Gabriel Morell · 2026-09-29 19:55

44 files +1254 -0
Message
{commit_body(@commit)}

Files changed

added .github/workflows/package.yml
+169 −0
@@ -0,0 +1,169 @@
1 +name: Package
2 +
3 +# Packaging follows ppl's pipeline (cargo-deb / cargo-generate-rpm,
4 +# stamped versions, publishing to the forge's registries), minus the
5 +# parts that only make sense for a Rust binary: nothing here compiles.
6 +
7 +on:
8 + push:
9 + branches: [ master ]
10 + tags: [ 'v*' ]
11 + pull_request:
12 + branches: [ master ]
13 +
14 +env:
15 + CARGO_TERM_COLOR: always
16 +
17 +jobs:
18 + package:
19 + # One runner, not ppl's per-arch matrix: every package here is
20 + # architecture-independent, and two runners would each upload the
21 + # same noarch filename -- the second one is refused with a 409.
22 + runs-on: arc-runner-set
23 + permissions:
24 + contents: read
25 + packages: write
26 +
27 + steps:
28 + - uses: actions/checkout@v4
29 +
30 + # Stdlib only, so the runner needs no numpy/Pillow. Catches a
31 + # render dropped in at the wrong size or a resolution added to one
32 + # theme and not the other.
33 + - name: Check the images
34 + run: python3 tools/standins.py --check
35 +
36 + - name: Install Rust
37 + uses: dtolnay/rust-toolchain@stable
38 + with:
39 + toolchain: stable
40 +
41 + - name: Setup Rust cache
42 + uses: Swatinem/rust-cache@v2
43 +
44 + - name: Install the packaging tools
45 + run: |
46 + set -euo pipefail
47 + cargo install cargo-deb --locked
48 + cargo install cargo-generate-rpm --locked
49 +
50 + # Same scheme as ppl: `+dev.<stamp>` on branch builds so every
51 + # build is a distinct, later version; a tag publishes the bare
52 + # version. The first `version = ` in the root manifest is the
53 + # workspace version every package inherits.
54 + - name: Stamp the package version
55 + run: |
56 + set -euo pipefail
57 + base=$(grep -m1 '^version = ' Cargo.toml | cut -d'"' -f2)
58 +
59 + if [ "${GITHUB_REF_TYPE:-}" = "tag" ]; then
60 + version="$base"
61 + else
62 + version="$base+dev.$(date -u +%s)"
63 + fi
64 +
65 + echo "version: $version"
66 + sed -i "0,/^version = .*/s//version = \"$version\"/" Cargo.toml
67 +
68 + - name: Build Debian packages
69 + run: |
70 + set -euo pipefail
71 + cargo deb -p plymouth-theme-neiam --no-build --no-strip
72 + cargo deb -p sddm-theme-neiam --no-build --no-strip
73 + tools/deb-arch-all.sh target/debian/*.deb
74 +
75 + - name: Build RPM packages
76 + run: |
77 + set -euo pipefail
78 + cargo generate-rpm -p plymouth -a noarch
79 + cargo generate-rpm -p sddm -a noarch
80 +
81 + - name: Resolve the forge URL
82 + env:
83 + CI_FORGE_URL: ${{ vars.CI_FORGE_URL }}
84 + run: |
85 + set -euo pipefail
86 + forge_url=${CI_FORGE_URL:-${GITHUB_SERVER_URL:-}}
87 +
88 + case "${forge_url:-}" in
89 + "")
90 + echo "No forge URL available; not publishing."
91 + echo "PUBLISH=false" >> "$GITHUB_ENV"
92 + ;;
93 + *://github.com|*://github.com/*|*://www.github.com*)
94 + echo "Running on GitHub, which has no package registry here."
95 + echo "PUBLISH=false" >> "$GITHUB_ENV"
96 + ;;
97 + *)
98 + echo "publishing to $forge_url"
99 + echo "FORGE_URL=$forge_url" >> "$GITHUB_ENV"
100 + echo "PUBLISH=true" >> "$GITHUB_ENV"
101 + ;;
102 + esac
103 +
104 + - name: Publish the .debs and the .rpms to the forge
105 + if: github.event_name != 'pull_request' && env.PUBLISH == 'true'
106 + env:
107 + REPOSITORY: ${{ github.repository }}
108 + TOKEN: ${{ github.token }}
109 + run: |
110 + set -euo pipefail
111 +
112 + for deb in target/debian/*.deb; do
113 + echo "publishing $deb"
114 + curl --fail-with-body -sS \
115 + -u "gitgud-actions:$TOKEN" \
116 + -H "Content-Type: application/vnd.debian.binary-package" \
117 + --data-binary "@$deb" \
118 + "$FORGE_URL/pkg/deb/$REPOSITORY/upload?dist=stable&component=main"
119 + echo
120 + done
121 +
122 + for rpm in target/generate-rpm/*.rpm; do
123 + echo "publishing $rpm"
124 + curl --fail-with-body -sS \
125 + -u "gitgud-actions:$TOKEN" \
126 + -H "Content-Type: application/x-rpm" \
127 + --data-binary "@$rpm" \
128 + "$FORGE_URL/pkg/rpm/$REPOSITORY/upload"
129 + echo
130 + done
131 +
132 + - name: How to install it
133 + if: github.event_name != 'pull_request' && env.PUBLISH == 'true'
134 + env:
135 + OWNER: ${{ github.repository_owner }}
136 + run: |
137 + cat <<EOF
138 + # Debian / Ubuntu
139 + curl -fsSL $FORGE_URL/pkg/_keys/deb/$OWNER | sudo tee /etc/apt/keyrings/$OWNER.asc >/dev/null
140 + echo "deb [signed-by=/etc/apt/keyrings/$OWNER.asc] $FORGE_URL/pkg/deb/$OWNER/_all stable main" | sudo tee /etc/apt/sources.list.d/$OWNER.list
141 + sudo apt update && sudo apt install plymouth-theme-neiam sddm-theme-neiam
142 +
143 + # Fedora / RHEL / openSUSE — /etc/yum.repos.d/$OWNER.repo
144 + [$OWNER]
145 + name=$OWNER
146 + baseurl=$FORGE_URL/pkg/rpm/$OWNER/_all
147 + enabled=1
148 + repo_gpgcheck=1
149 + # cargo-generate-rpm produces unsigned packages; the forge
150 + # signs the index, not what it was handed.
151 + gpgcheck=0
152 + gpgkey=$FORGE_URL/pkg/_keys/rpm/$OWNER
153 + EOF
154 +
155 + # Artifact storage is a GitHub feature; off GitHub these skip
156 + # rather than fail, as in ppl.
157 + - name: Upload Debian packages
158 + uses: actions/upload-artifact@v4
159 + if: ${{ startsWith(github.server_url, 'https://github.com') }}
160 + with:
161 + name: neiam-device-debs
162 + path: target/debian/*.deb
163 +
164 + - name: Upload RPM packages
165 + uses: actions/upload-artifact@v4
166 + if: ${{ startsWith(github.server_url, 'https://github.com') }}
167 + with:
168 + name: neiam-device-rpms
169 + path: target/generate-rpm/*.rpm
added .gitignore
+1 −0
@@ -0,0 +1 @@
1 +/target
added Cargo.lock
+11 −0
@@ -0,0 +1,11 @@
1 +# This file is automatically @generated by Cargo.
2 +# It is not intended for manual editing.
3 +version = 4
4 +
5 +[[package]]
6 +name = "plymouth-theme-neiam"
7 +version = "0.1.0"
8 +
9 +[[package]]
10 +name = "sddm-theme-neiam"
11 +version = "0.1.0"
added Cargo.toml
+13 −0
@@ -0,0 +1,13 @@
1 +# The packages here are data, not Rust. They are cargo crates only so
2 +# they go through the same cargo-deb / cargo-generate-rpm pipeline as
3 +# ppl and publish to the same registries.
4 +[workspace]
5 +resolver = "2"
6 +members = ["plymouth", "sddm"]
7 +
8 +# CI stamps this line (the first `version = ` in the file) per build.
9 +[workspace.package]
10 +version = "0.1.0"
11 +edition = "2021"
12 +authors = ["Gabe <gabe@neiam.org>"]
13 +license = "GPLv3"
added README.md
+75 −0
@@ -0,0 +1,75 @@
1 +# neiam-device
2 +
3 +Branding packages for neiam devices, published as `.deb` and `.rpm`
4 +through the same pipeline as ppl.
5 +
6 +| Package | Installs to |
7 +|------------------------|--------------------------------------|
8 +| `plymouth-theme-neiam` | `/usr/share/plymouth/themes/neiam/` |
9 +| `sddm-theme-neiam` | `/usr/share/sddm/themes/neiam/` |
10 +
11 +Both are architecture-independent (`all` / `noarch`).
12 +
13 +## Images
14 +
15 +Every background is rendered per resolution rather than scaled from
16 +one master, and each theme picks the render that best fits the screen
17 +(matching aspect ratio first, then least scaling, preferring to shrink):
18 +
19 + plymouth/theme/background-<W>x<H>.png
20 + sddm/theme/backgrounds/<W>x<H>.png
21 +
22 +at 1280x800, 1366x768, 1920x1080, 1920x1200, 2560x1440, 2560x1600 and
23 +3840x2160.
24 +
25 +The files committed now are stand-ins: solid `#651d1d` with a `#fef3c7`
26 +moire fading out into it. Blender renders replace them by overwriting
27 +the file at the same path; nothing else needs to change.
28 +
29 + tools/standins.py # write any missing stand-ins (needs numpy, Pillow)
30 + tools/standins.py --force # rewrite them all
31 + tools/standins.py --check # every image present at its size? (CI runs this)
32 +
33 +Adding or dropping a resolution means editing three lists together:
34 +`RESOLUTIONS` in `tools/standins.py`, the `bg_*` table in
35 +`plymouth/theme/neiam.script`, and `backgrounds` in
36 +`sddm/theme/theme.conf`.
37 +
38 +The Plymouth theme is copied into the initramfs, so every render there
39 +adds to its size.
40 +
41 +## Enabling
42 +
43 +Installing a package does not switch to its theme:
44 +
45 + # Plymouth (rebuilds the initramfs)
46 + sudo plymouth-set-default-theme -R neiam # Fedora / openSUSE
47 + sudo update-alternatives --set default.plymouth \
48 + /usr/share/plymouth/themes/neiam/neiam.plymouth \
49 + && sudo update-initramfs -u # Debian / Ubuntu
50 +
51 + # SDDM
52 + printf '[Theme]\nCurrent=neiam\n' | sudo tee /etc/sddm.conf.d/neiam.conf
53 +
54 +Try the login screen without switching to it:
55 +
56 + sddm-greeter-qt6 --test-mode --theme sddm/theme
57 +
58 +## Building
59 +
60 +The packages are data-only cargo crates so that `cargo-deb` and
61 +`cargo-generate-rpm` apply as they do for ppl:
62 +
63 + cargo deb -p plymouth-theme-neiam --no-build --no-strip
64 + cargo deb -p sddm-theme-neiam --no-build --no-strip
65 + tools/deb-arch-all.sh target/debian/*.deb
66 + cargo generate-rpm -p plymouth -a noarch
67 + cargo generate-rpm -p sddm -a noarch
68 +
69 +`cargo-deb` can't mark a package `Architecture: all`, so
70 +`tools/deb-arch-all.sh` rewrites that one control field afterwards.
71 +
72 +CI (`.github/workflows/package.yml`) does the above on every push,
73 +stamping `+dev.<timestamp>` onto branch builds and publishing to the
74 +forge's deb and rpm registries. Releases use `./release.sh` as in ppl:
75 +a `v*` tag publishes the bare version.
added plymouth/Cargo.toml
+31 −0

Click to load diff…

added plymouth/src/lib.rs
+1 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

added plymouth/theme/neiam.plymouth
+8 −0

Click to load diff…

added plymouth/theme/neiam.script
+155 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

added release.sh
+333 −0

Click to load diff…

added sddm/Cargo.toml
+32 −0

Click to load diff…

added sddm/src/lib.rs
+1 −0

Click to load diff…

added sddm/theme/Action.qml
+25 −0

Click to load diff…

added sddm/theme/Field.qml
+51 −0

Click to load diff…

added sddm/theme/Main.qml
+151 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

added sddm/theme/metadata.desktop
+11 −0

Click to load diff…

added sddm/theme/theme.conf
+6 −0

Click to load diff…

added tools/deb-arch-all.sh
+32 −0

Click to load diff…

added tools/standins.py
+148 −0

Click to load diff…

Parents: