fix(moonarch-git): own /etc/swaylock/config, install blurred wallpaper
Build and publish packages / build-and-publish (push) Successful in 14s

swaylock never reads /etc/xdg/, so the config is installed explicitly to
/etc/swaylock/config — its SYSCONFDIR path — instead of going through the
generic defaults/xdg/ sweep. The home seeding drops out; pre_upgrade
retires the pristine copies it left behind (cmp against the still-old
/etc/xdg file, so an edited copy survives) and clears a manually deployed
/etc/swaylock/config that pacman would refuse to overwrite.

wallpaper-blur.jpg ships next to the plain wallpaper as the lock screen
background.
This commit is contained in:
2026-08-18 17:37:55 +02:00
parent ac1922b809
commit 53f94e548f
2 changed files with 40 additions and 16 deletions
+10 -2
View File
@@ -5,7 +5,7 @@
pkgname=moonarch-git
pkgver=r166.e21c046
pkgrel=19
pkgrel=20
pkgdesc="Moonarch desktop environment defaults — Niri, Waybar, Catppuccin Mocha"
arch=('any')
url="https://gitea.moonarch.de/nevaforget/moonarch"
@@ -174,9 +174,11 @@ package() {
# --- Zsh config ---
install -Dm644 defaults/shell/zshrc "$pkgdir/etc/zsh/zshrc.moonarch"
# --- Wallpaper ---
# --- Wallpaper (plain + blurred variant for the lock screen) ---
install -Dm644 defaults/backgrounds/wallpaper.jpg \
"$pkgdir/usr/share/moonarch/wallpaper.jpg"
install -Dm644 defaults/backgrounds/wallpaper-blur.jpg \
"$pkgdir/usr/share/moonarch/wallpaper-blur.jpg"
# --- Package lists (data files for moonarch-update) ---
install -Dm644 packages/official.txt "$pkgdir/usr/share/moonarch/official.txt"
@@ -199,6 +201,12 @@ package() {
# --- mpv config (owned by moonarch-git; ModernZ color overrides via script-opts-append) ---
install -Dm644 defaults/etc/mpv/mpv.conf "$pkgdir/etc/mpv/mpv.conf"
# --- swaylock config (owned; /etc/swaylock is swaylock's SYSCONFDIR path.
# swaylock reads ~/.swaylock/config, $XDG_CONFIG_HOME/swaylock/config and
# SYSCONFDIR/swaylock/config — never /etc/xdg/, so this must not go through
# the XDG sweep above. A user copy under ~/.config still takes precedence. ---
install -Dm644 defaults/etc/swaylock/config "$pkgdir/etc/swaylock/config"
# --- Fontconfig generic-family defaults (owned; number 65 loads after 60-latin to win) ---
install -Dm644 defaults/etc/fonts/conf.d/65-moonarch-fonts.conf \
"$pkgdir/etc/fonts/conf.d/65-moonarch-fonts.conf"
+30 -14
View File
@@ -27,20 +27,9 @@ post_install() {
cp /usr/share/moonarch/swaync/config.json /etc/xdg/swaync/config.json
cp /usr/share/moonarch/swaync/style.css /etc/xdg/swaync/style.css
# Deploy swaylock config to skel and existing user homes. swaylock never
# reads /etc/xdg/, and its SYSCONFDIR copy is not what post-install.sh
# seeds, so the home copy is the one that counts. Never overwrites.
if [ -f /etc/xdg/swaylock/config ]; then
install -Dm644 /etc/xdg/swaylock/config /etc/skel/.config/swaylock/config
while IFS=: read -r _ _ uid gid _ home _; do
if [ "$uid" -ge 1000 ] && [ "$uid" -lt 60000 ] && [ -d "$home" ]; then
if [ ! -f "$home/.config/swaylock/config" ]; then
install -Dm644 -o "$uid" -g "$gid" /etc/xdg/swaylock/config \
"$home/.config/swaylock/config"
fi
fi
done < /etc/passwd
fi
# swaylock needs no home seeding: the config is owned at /etc/swaylock/config,
# which is swaylock's own SYSCONFDIR path, so the package makes it effective
# on its own. See pre_upgrade for the retirement of the former home copies.
# Deploy Walker config override to skel and existing user homes.
# Only copies if user has no config yet — never overwrites manual edits.
@@ -104,6 +93,13 @@ pre_upgrade() {
rm -rf /etc/xdg/walker/themes/moonarch
fi
# Remove a manually deployed /etc/swaylock/config. The package owns that path
# now; pacman refuses to overwrite a file it does not own. Same reason as the
# walker theme cleanup above.
if [ -f /etc/swaylock/config ] && ! pacman -Qo /etc/swaylock/config &>/dev/null; then
rm -f /etc/swaylock/config
fi
# Migrate cliphist.service → cliphist-text + cliphist-image
if [ -f /etc/systemd/user/cliphist.service ]; then
while IFS=: read -r _ _ uid _ _ home _; do
@@ -133,6 +129,26 @@ pre_upgrade() {
# moongreet.toml.bak predates the package and is owned by nothing. The
# rest of /etc/moongreet/ goes with `pacman -Rns moongreet`.
rm -f /etc/moongreet/moongreet.toml.bak 2>/dev/null || true
# Retire the seeded swaylock home copies. The config now ships to
# /etc/swaylock/config, but the home paths are searched first, so a leftover
# seed copy would shadow it forever — including the blurred wallpaper.
# Only untouched copies go: pre_upgrade still sees the old /etc/xdg file, so
# `cmp` distinguishes a pristine seed from one the user edited. An edited
# copy stays and keeps winning, which is what a user config is for.
if [ -f /etc/xdg/swaylock/config ]; then
if cmp -s /etc/skel/.config/swaylock/config /etc/xdg/swaylock/config; then
rm -f /etc/skel/.config/swaylock/config
rmdir /etc/skel/.config/swaylock 2>/dev/null || true
fi
while IFS=: read -r _ _ uid _ _ home _; do
if [ "$uid" -ge 1000 ] && [ "$uid" -lt 60000 ] \
&& cmp -s "$home/.config/swaylock/config" /etc/xdg/swaylock/config; then
rm -f "$home/.config/swaylock/config"
rmdir "$home/.config/swaylock" 2>/dev/null || true
fi
done < /etc/passwd
fi
}
post_upgrade() {