feat(branding): restore the boot splash, SDDM theme, and greeter background
Neither the Plymouth theme nor the login/lock theming was ever installed by a restore, so a rebuilt box came up with stock distro branding. bin/boot-branding.sh installs all three, and the desktop stage of restore-linux.sh calls it. Each block self-skips when its greeter is absent or already current, so it is cheap to re-run and works whether the box boots lightdm or SDDM: - Plymouth: a real copy under /usr/share/plymouth/themes, not a symlink into the user home. The stock initramfs hook copies the theme path verbatim, so a symlink into an unmounted home dangles at early boot and Plymouth drops to text mode -- which is what assets/boot/initramfs-hook-my-custom-logo existed to work around. With a real copy that hook is unnecessary. - SDDM: the NexusOS-QML theme, selected via /etc/sddm.conf.d. - slick-greeter: cannot lay out a custom login screen, so the logo and wordmark are baked into assets/themes/greeter/greeter-background.svg and its own centered login box lands underneath. Main.qml now loads background.png instead of background.svg. QtSvg implements SVG Tiny 1.2, which has no <pattern>, so the brushed-metal and machine-line textures silently dropped out at runtime. librsvg renders them, so the SVG is rasterized at 1920x1200 and committed alongside it; the regeneration command is in the comment above the source: line. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
5294ab7c78
commit
f46e53de15
@@ -31,7 +31,16 @@ Rectangle {
|
||||
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
source: "assets/background.svg"
|
||||
// background.png, not the .svg it was rendered from: QtSvg implements
|
||||
// SVG Tiny 1.2, which has no <pattern>, so the brushed-metal and
|
||||
// machine-line textures silently drop out ("Could not resolve property:
|
||||
// #brushLines"). librsvg renders them fine, so the SVG is rasterized at
|
||||
// 1920x1200 and committed. Regenerate after editing background.svg:
|
||||
// python3 -c 'import gi; gi.require_version("GdkPixbuf","2.0"); \
|
||||
// from gi.repository import GdkPixbuf as G; \
|
||||
// G.Pixbuf.new_from_file_at_scale("assets/background.svg",1920,1200,False) \
|
||||
// .savev("assets/background.png","png",["compression"],["9"])'
|
||||
source: "assets/background.png"
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
smooth: true
|
||||
asynchronous: false
|
||||
@@ -71,7 +80,7 @@ Rectangle {
|
||||
|
||||
Text {
|
||||
id: brandLabel
|
||||
text: "NexusOS"
|
||||
text: "Welcome to NexusOS"
|
||||
color: textPrimary
|
||||
font.family: "Sans"
|
||||
font.pixelSize: 28
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 192 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 249 KiB |
Executable
+118
@@ -0,0 +1,118 @@
|
||||
#!/bin/bash
|
||||
# NexusOS boot-time branding: the Plymouth boot splash and the LightDM greeter
|
||||
# (which is also what you see on lock -- light-locker just switches to it).
|
||||
#
|
||||
# Both are system-level and need root, which is why this is a standalone script
|
||||
# rather than part of assets/themes/install-theme.sh.
|
||||
#
|
||||
# Usage: sudo bin/boot-branding.sh [--uninstall]
|
||||
set -euo pipefail
|
||||
|
||||
NEXUS_ROOT="${NEXUS_ROOT:-$(cd "$(dirname "$(realpath "$0")")/.." && pwd)}"
|
||||
|
||||
# Plymouth. A real copy is placed under /usr/share/plymouth/themes -- NOT a
|
||||
# symlink into /home. The stock initramfs plymouth hook copies the theme path
|
||||
# verbatim, so a symlink into an unmounted /home dangles at early boot and
|
||||
# Plymouth falls back to text mode. That is what
|
||||
# assets/boot/initramfs-hook-my-custom-logo exists to work around; with a real
|
||||
# copy the hook is unnecessary.
|
||||
SRC="$NEXUS_ROOT/assets/boot/my-custom-logo"
|
||||
DEST=/usr/share/plymouth/themes/my-custom-logo
|
||||
THEME="$DEST/my-custom-logo.plymouth"
|
||||
|
||||
# Greeter. slick-greeter cannot lay out a custom login screen the way the
|
||||
# NexusOS-QML SDDM theme does, so the logo and wordmark are baked into the
|
||||
# background image instead and the greeter's own centered login box lands under
|
||||
# them. The SVG is used as-is: gdk-pixbuf's SVG loader is installed, so there is
|
||||
# nothing to rasterize. Copied out of the repo because the greeter runs as user
|
||||
# `lightdm` and the user home is 0750, so nothing in here is readable to it.
|
||||
GREETER_ART="$NEXUS_ROOT/assets/themes/greeter/greeter-background.svg"
|
||||
GREETER_DIR=/usr/share/nexusos
|
||||
GREETER_CONF=/etc/lightdm/slick-greeter.conf
|
||||
|
||||
# SDDM. Its greeter is a QML app, so unlike slick-greeter it can draw the real
|
||||
# layout (logo, wordmark, login box, clock) -- this is the theme the design was
|
||||
# written for. Installed whenever sddm is present, regardless of which display
|
||||
# manager is currently active, so switching between the two needs no re-run.
|
||||
SDDM_SRC="$NEXUS_ROOT/assets/themes/KDE/sddm/NexusOS-QML"
|
||||
SDDM_DEST=/usr/share/sddm/themes/NexusOS-QML
|
||||
SDDM_CONF=/etc/sddm.conf.d/nexusos.conf
|
||||
|
||||
[ "$(id -u)" -eq 0 ] || { echo "run with sudo"; exit 1; }
|
||||
|
||||
if [ "${1:-}" = "--uninstall" ]; then
|
||||
update-alternatives --remove default.plymouth "$THEME" 2>/dev/null || true
|
||||
rm -rf "$DEST" "$GREETER_DIR" "$GREETER_CONF" "$SDDM_DEST" "$SDDM_CONF"
|
||||
command -v update-initramfs >/dev/null && update-initramfs -u
|
||||
echo "reverted to the distro defaults"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# --- Plymouth boot splash -----------------------------------------------------
|
||||
if [ ! -d "$SRC" ]; then
|
||||
echo "missing theme source: $SRC -- skipping boot splash"
|
||||
elif ! command -v update-initramfs >/dev/null || [ ! -d /usr/share/plymouth/themes ]; then
|
||||
echo "no Plymouth on this box -- skipping boot splash"
|
||||
# update-initramfs is slow, and a restore runs this every time. Bail out when the
|
||||
# installed copy already matches the repo and the alternative already points here.
|
||||
elif diff -rq "$SRC" "$DEST" >/dev/null 2>&1 &&
|
||||
[ "$(readlink -f /usr/share/plymouth/themes/default.plymouth)" = "$THEME" ]; then
|
||||
echo "boot splash already installed"
|
||||
else
|
||||
rm -rf "$DEST"
|
||||
cp -aL "$SRC" "$DEST"
|
||||
chown -R root:root "$DEST"
|
||||
chmod -R a+rX,go-w "$DEST"
|
||||
|
||||
update-alternatives --install /usr/share/plymouth/themes/default.plymouth \
|
||||
default.plymouth "$THEME" 300
|
||||
update-alternatives --set default.plymouth "$THEME"
|
||||
update-initramfs -u
|
||||
echo "boot splash installed"
|
||||
fi
|
||||
|
||||
# --- LightDM greeter (login + lock) -------------------------------------------
|
||||
# Only slick-greeter is configured here; it's what Mint/XFCE ships and it reads
|
||||
# this file directly. theme-name is deliberately left alone -- the NexusOS GTK
|
||||
# theme lives in ~/.themes, which the lightdm user cannot read, so pointing at it
|
||||
# would just fall back silently. Colors below are the NexusOS-QML palette
|
||||
# (theme.conf: bgDark).
|
||||
if [ ! -f "$GREETER_ART" ]; then
|
||||
echo "missing $GREETER_ART -- skipping greeter"
|
||||
elif ! command -v slick-greeter >/dev/null; then
|
||||
echo "no slick-greeter on this box -- skipping greeter"
|
||||
else
|
||||
install -D -m 644 -o root -g root "$GREETER_ART" "$GREETER_DIR/greeter-background.svg"
|
||||
cat > "$GREETER_CONF" <<EOF
|
||||
[Greeter]
|
||||
background=$GREETER_DIR/greeter-background.svg
|
||||
background-color=#0a0e1a
|
||||
draw-user-backgrounds=false
|
||||
draw-grid=false
|
||||
content-align=center
|
||||
stretch-background-across-monitors=false
|
||||
EOF
|
||||
chmod 644 "$GREETER_CONF"
|
||||
echo "greeter background installed"
|
||||
fi
|
||||
|
||||
# --- SDDM greeter -------------------------------------------------------------
|
||||
if [ ! -d "$SDDM_SRC" ]; then
|
||||
echo "missing $SDDM_SRC -- skipping SDDM theme"
|
||||
elif [ ! -d /usr/share/sddm/themes ]; then
|
||||
echo "no SDDM on this box -- skipping SDDM theme"
|
||||
else
|
||||
rm -rf "$SDDM_DEST"
|
||||
cp -aL "$SDDM_SRC" "$SDDM_DEST"
|
||||
chown -R root:root "$SDDM_DEST"
|
||||
chmod -R a+rX,go-w "$SDDM_DEST"
|
||||
install -d -m 755 /etc/sddm.conf.d
|
||||
cat > "$SDDM_CONF" <<EOF
|
||||
[Theme]
|
||||
Current=NexusOS-QML
|
||||
EOF
|
||||
chmod 644 "$SDDM_CONF"
|
||||
echo "SDDM theme installed"
|
||||
fi
|
||||
|
||||
echo "done -- reboot to see it."
|
||||
@@ -196,6 +196,15 @@ else
|
||||
echo "Warning: $panel_installer not found — skipping panel install."
|
||||
fi
|
||||
|
||||
# Boot branding — the Plymouth splash. Not XFCE-specific, but it's cosmetic and
|
||||
# writes outside the repo, so it belongs to the skippable stage like os-release
|
||||
# below. Self-skips when the theme is already installed (initramfs rebuild is slow).
|
||||
if [ -x "$NEXUS_ROOT/bin/boot-branding.sh" ]; then
|
||||
echo ""
|
||||
echo "Installing NexusOS boot branding (splash + greeter)..."
|
||||
sudo "$NEXUS_ROOT/bin/boot-branding.sh" || echo "Warning: boot branding skipped."
|
||||
fi
|
||||
|
||||
# Distro branding — the About dialog / neofetch read /etc/os-release.
|
||||
if grep -q '^ID=linuxmint' /etc/os-release 2>/dev/null && ! grep -q 'NexusOS' /etc/os-release; then
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user