2026-04-30 03:43:33 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
# veilor-os — apply system-wide KDE theme + DuckSans font default
|
|
|
|
|
# Run during %post (chroot) or post-install. Idempotent.
|
|
|
|
|
|
|
|
|
|
set -uo pipefail
|
|
|
|
|
|
|
|
|
|
GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m'
|
|
|
|
|
ok() { echo -e "${GREEN}[OK]${NC} $*"; }
|
|
|
|
|
info() { echo -e "${YELLOW}[INFO]${NC} $*"; }
|
|
|
|
|
|
|
|
|
|
REPO="${VEILOR_REPO:-/usr/share/veilor-os}"
|
|
|
|
|
|
|
|
|
|
# ── Install color scheme system-wide ──
|
|
|
|
|
info "Installing veilor-black color scheme"
|
|
|
|
|
install -d -m 0755 /usr/share/color-schemes
|
|
|
|
|
install -m 0644 "$REPO/assets/kde/veilor-black.colors" /usr/share/color-schemes/veilor-black.colors
|
|
|
|
|
ok "color scheme installed"
|
|
|
|
|
|
|
|
|
|
# ── KDE system defaults ──
|
|
|
|
|
info "Setting system kdedefaults"
|
|
|
|
|
install -d -m 0755 /etc/xdg/kdedefaults
|
|
|
|
|
install -m 0644 "$REPO/assets/kde/veilor-default.kdeglobals" /etc/xdg/kdedefaults/kdeglobals
|
|
|
|
|
ok "kdedefaults written"
|
|
|
|
|
|
2026-04-30 03:57:17 +01:00
|
|
|
# ── Fira Code fontconfig default (monospace + UI) ──
|
|
|
|
|
info "Setting Fira Code as default font"
|
|
|
|
|
rpm -q fira-code-fonts &>/dev/null || dnf install -y fira-code-fonts
|
2026-04-30 03:43:33 +01:00
|
|
|
install -d -m 0755 /etc/fonts/conf.d
|
2026-04-30 03:57:17 +01:00
|
|
|
cat > /etc/fonts/conf.d/55-veilor-firacode.conf << 'EOF'
|
2026-04-30 03:43:33 +01:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
|
|
|
|
<fontconfig>
|
2026-04-30 03:57:17 +01:00
|
|
|
<alias>
|
|
|
|
|
<family>monospace</family>
|
|
|
|
|
<prefer><family>Fira Code</family></prefer>
|
|
|
|
|
</alias>
|
2026-04-30 03:43:33 +01:00
|
|
|
<alias>
|
|
|
|
|
<family>sans-serif</family>
|
2026-04-30 03:57:17 +01:00
|
|
|
<prefer><family>Fira Code</family></prefer>
|
2026-04-30 03:43:33 +01:00
|
|
|
</alias>
|
|
|
|
|
<alias>
|
|
|
|
|
<family>system-ui</family>
|
2026-04-30 03:57:17 +01:00
|
|
|
<prefer><family>Fira Code</family></prefer>
|
2026-04-30 03:43:33 +01:00
|
|
|
</alias>
|
|
|
|
|
</fontconfig>
|
|
|
|
|
EOF
|
2026-04-30 03:57:17 +01:00
|
|
|
fc-cache -f 2>/dev/null || true
|
|
|
|
|
ok "fontconfig: Fira Code = default font"
|
2026-04-30 03:43:33 +01:00
|
|
|
|
|
|
|
|
# ── /etc/os-release branding ──
|
|
|
|
|
info "Branding /etc/os-release"
|
2026-05-01 18:25:57 +01:00
|
|
|
SRC_OSREL=""
|
|
|
|
|
for cand in /etc/os-release.d/veilor "$REPO/overlay/etc/os-release.d/veilor"; do
|
|
|
|
|
[[ -f $cand ]] && SRC_OSREL=$cand && break
|
|
|
|
|
done
|
|
|
|
|
if [[ -n $SRC_OSREL ]]; then
|
|
|
|
|
# /etc/os-release is symlink to /usr/lib/os-release on Fedora.
|
|
|
|
|
# Overwrite the actual file and rewire symlinks deterministically.
|
|
|
|
|
rm -f /etc/os-release /usr/lib/os-release
|
|
|
|
|
install -m 0644 "$SRC_OSREL" /usr/lib/os-release
|
|
|
|
|
ln -sf ../usr/lib/os-release /etc/os-release
|
|
|
|
|
ok "os-release set to veilor-os (source: $SRC_OSREL)"
|
|
|
|
|
else
|
|
|
|
|
warn "no os-release.d/veilor found — branding skipped"
|
2026-04-30 03:43:33 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# ── Plymouth theme (optional) ──
|
|
|
|
|
if [[ -d "$REPO/assets/plymouth/veilor" ]] && command -v plymouth-set-default-theme &>/dev/null; then
|
|
|
|
|
info "Installing plymouth theme"
|
|
|
|
|
install -d -m 0755 /usr/share/plymouth/themes/veilor
|
|
|
|
|
cp -r "$REPO/assets/plymouth/veilor/." /usr/share/plymouth/themes/veilor/
|
|
|
|
|
plymouth-set-default-theme -R veilor 2>/dev/null || true
|
|
|
|
|
ok "plymouth theme set to veilor"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
ok "kde-theme-apply complete"
|