diff --git a/assets/themes/KDE/sddm/NexusOS-QML/Main.qml b/assets/themes/KDE/sddm/NexusOS-QML/Main.qml index e8b5ed7..8cae5da 100644 --- a/assets/themes/KDE/sddm/NexusOS-QML/Main.qml +++ b/assets/themes/KDE/sddm/NexusOS-QML/Main.qml @@ -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 , 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 diff --git a/assets/themes/KDE/sddm/NexusOS-QML/assets/background.png b/assets/themes/KDE/sddm/NexusOS-QML/assets/background.png new file mode 100644 index 0000000..f345646 Binary files /dev/null and b/assets/themes/KDE/sddm/NexusOS-QML/assets/background.png differ diff --git a/assets/themes/greeter/greeter-background.svg b/assets/themes/greeter/greeter-background.svg new file mode 100644 index 0000000..d4b0dc8 --- /dev/null +++ b/assets/themes/greeter/greeter-background.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Welcome to NexusOS + + + + diff --git a/bin/boot-branding.sh b/bin/boot-branding.sh new file mode 100755 index 0000000..aec645a --- /dev/null +++ b/bin/boot-branding.sh @@ -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" < "$SDDM_CONF" </dev/null && ! grep -q 'NexusOS' /etc/os-release; then echo ""