Compare commits

...

2 Commits

Author SHA1 Message Date
f837ecbeb4 fix(moonarch-git): remove untracked walker theme files before upgrade
All checks were successful
Build and publish packages / build-and-publish (push) Successful in 1s
Walker theme files at /etc/xdg/walker/themes/moonarch/ were deployed
manually before the package owned them, causing pacman file conflicts
on upgrade. pre_upgrade hook now removes untracked files so pacman
can take ownership cleanly.
2026-04-08 09:59:09 +02:00
8e2fb5a9f5 feat(moonarch-git): package battery conservation mode assets
Add udev rule and systemd service to PKGBUILD. Create /var/lib/moonarch
state directory and enable batsaver restore service on laptops in the
post-install hook.
2026-04-08 09:59:09 +02:00
2 changed files with 22 additions and 0 deletions

View File

@ -190,6 +190,14 @@ package() {
"$pkgdir/etc/systemd/user/graphical-session.target.wants/$(basename "$svc")" "$pkgdir/etc/systemd/user/graphical-session.target.wants/$(basename "$svc")"
done done
# --- udev rules -> /usr/lib/udev/rules.d/ ---
install -Dm644 defaults/etc/udev/rules.d/90-moonarch-battery.rules \
"$pkgdir/usr/lib/udev/rules.d/90-moonarch-battery.rules"
# --- Systemd system service (battery conservation restore) -> /usr/lib/systemd/system/ ---
install -Dm644 defaults/etc/systemd/system/moonarch-batsaver.service \
"$pkgdir/usr/lib/systemd/system/moonarch-batsaver.service"
} }
backup=( backup=(

View File

@ -71,11 +71,25 @@ post_install() {
rm -f /usr/local/bin/swww /usr/local/bin/swww-daemon 2>/dev/null || true rm -f /usr/local/bin/swww /usr/local/bin/swww-daemon 2>/dev/null || true
rm -f /usr/local/bin/moonarch-update 2>/dev/null || true rm -f /usr/local/bin/moonarch-update 2>/dev/null || true
# Battery conservation mode: create state directory and enable restore service
install -dm775 -g wheel /var/lib/moonarch
if [ -f /sys/class/power_supply/BAT0/charge_control_end_threshold ]; then
systemctl enable moonarch-batsaver.service 2>/dev/null || true
fi
echo "==> Moonarch defaults installed." echo "==> Moonarch defaults installed."
echo "==> For first-time setup run: /opt/moonarch/scripts/post-install.sh" echo "==> For first-time setup run: /opt/moonarch/scripts/post-install.sh"
echo "==> This enables services and configures firewall." echo "==> This enables services and configures firewall."
} }
pre_upgrade() {
# Remove untracked walker theme files from pre-package manual deploys.
# Without this, pacman refuses to overwrite files it doesn't own.
if [ -d /etc/xdg/walker/themes/moonarch ] && ! pacman -Qo /etc/xdg/walker/themes/moonarch/style.css &>/dev/null; then
rm -rf /etc/xdg/walker/themes/moonarch
fi
}
post_upgrade() { post_upgrade() {
post_install post_install
} }