From b737bc7ceed97e44e55fb74935fe720e5da0e5d5 Mon Sep 17 00:00:00 2001 From: nevaforget Date: Mon, 4 May 2026 14:14:41 +0200 Subject: [PATCH] moonarch-git: skip wlsunset in global enable loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The blanket WantedBy-symlink loop installed a global-scope link for wlsunset, which meant `systemctl --user disable` (the waybar nightlight toggle's mechanism) could never persist — systemd warned about exactly this scope mismatch on every disable. Filter survived reboots even when the user turned it off. PKGBUILD now skips wlsunset; moonarch.install drops the legacy symlink on upgrade. pkgrel bumped so installed systems pick up the fix. --- DECISIONS.md | 7 +++++++ moonarch-git/PKGBUILD | 16 ++++++++++++---- moonarch-git/moonarch.install | 5 +++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/DECISIONS.md b/DECISIONS.md index b7775b8..8394fd5 100644 --- a/DECISIONS.md +++ b/DECISIONS.md @@ -1,5 +1,12 @@ # Decisions +## 2026-05-04 – moonarch-git: skip wlsunset in global enable loop + +- **Who**: Dominik, ClaudeCode +- **Why**: PKGBUILD's blanket loop over `defaults/etc/systemd/user/*.service` created `/etc/systemd/user/graphical-session.target.wants/wlsunset.service` — a global-scope symlink. The waybar nightlight toggle calls `systemctl --user disable wlsunset`, which only touches user-scope symlinks; the global one persists, so the filter came back on every reboot. Fix coordinates with moonarch repo (post-install.sh and CLAUDE.md updates) — see `moonarch/DECISIONS.md` 2026-05-04 entry. +- **Tradeoffs**: A whitelist of services-to-enable (instead of blacklist) would be cleaner long-term, but the project ships exactly one toggle-able user service today; a `skip_enable` array reads more clearly against the existing loop. `pre_upgrade()` cleanup is conservative: removes only the wlsunset wants-symlink, leaves the unit file itself. +- **How**: PKGBUILD `package()` — symlink loop now consults `skip_enable=("wlsunset.service")` and skips matching basenames. `moonarch.install` `pre_upgrade()` — deletes pre-existing `/etc/systemd/user/graphical-session.target.wants/wlsunset.service` so installed systems migrate cleanly. `pkgrel` bumped 11 → 12 so existing installs see the fix on next `pacman -Syu`; otherwise the registry would carry a same-versioned package and clients would skip the upgrade. + ## 2026-04-28 – Bump epoch on moongreet-git after upstream version rollback - **Who**: Dominik, ClaudeCode - **Why**: `pacman -Syu` warned that local `moongreet-git 0.10.0.r0.gce9f219-3` is "newer" than the moonarch registry's `0.8.6.r0.gb9b6f50-1`. Cause: `greetd-moongreet` upstream was tagged `v0.9.0` and `v0.10.0` early on, then the tag history continued with `v0.8.4` → `v0.8.5` → `v0.8.6` patches on top — a deliberate downgrade of the version line. `pkgver()` uses `git describe --long --tags`, which now returns `0.8.6.r0.gb9b6f50` at HEAD, but any system that built moongreet before the tag rollback still has the higher-sorting `0.10.0` installed. Without an epoch bump, those systems will never accept the registry's 0.8.x as an upgrade. diff --git a/moonarch-git/PKGBUILD b/moonarch-git/PKGBUILD index cb03a97..bea70b0 100644 --- a/moonarch-git/PKGBUILD +++ b/moonarch-git/PKGBUILD @@ -5,7 +5,7 @@ pkgname=moonarch-git pkgver=r123.952776c -pkgrel=11 +pkgrel=12 pkgdesc="Moonarch desktop environment defaults — Niri, Waybar, Catppuccin Mocha" arch=('any') url="https://gitea.moonarch.de/nevaforget/moonarch" @@ -209,11 +209,19 @@ package() { # --- Systemd user services -> /etc/systemd/user/ --- install -Dm644 defaults/etc/systemd/user/*.service -t "$pkgdir/etc/systemd/user/" - # Enable services by creating the WantedBy symlinks directly + # Enable services by creating the WantedBy symlinks directly. + # Toggle-able services (user-controlled via UI) are skipped here so + # `systemctl --user disable` can actually take effect — a global-scope + # symlink in /etc/ would override any user-scope disable. install -dm755 "$pkgdir/etc/systemd/user/graphical-session.target.wants" + skip_enable=("wlsunset.service") for svc in defaults/etc/systemd/user/*.service; do - ln -sf "../$(basename "$svc")" \ - "$pkgdir/etc/systemd/user/graphical-session.target.wants/$(basename "$svc")" + name="$(basename "$svc")" + for s in "${skip_enable[@]}"; do + [[ "$name" == "$s" ]] && continue 2 + done + ln -sf "../$name" \ + "$pkgdir/etc/systemd/user/graphical-session.target.wants/$name" done # --- Systemd system service (battery conservation restore) -> /usr/lib/systemd/system/ --- diff --git a/moonarch-git/moonarch.install b/moonarch-git/moonarch.install index 6bddee1..a82a746 100644 --- a/moonarch-git/moonarch.install +++ b/moonarch-git/moonarch.install @@ -95,6 +95,11 @@ pre_upgrade() { done < /etc/passwd rm -f /etc/systemd/user/graphical-session.target.wants/cliphist.service 2>/dev/null || true fi + + # Drop legacy global-scope wlsunset enablement. Nightlight is a toggle — + # the global symlink overrode user-scope disable, so the filter survived + # reboots even after the user turned it off. + rm -f /etc/systemd/user/graphical-session.target.wants/wlsunset.service 2>/dev/null || true } post_upgrade() {