feat: install systemd user services to /etc/systemd/user/
All checks were successful
Build and publish packages / build-and-publish (push) Successful in 8s
All checks were successful
Build and publish packages / build-and-publish (push) Successful in 8s
- PKGBUILD installs services directly to /etc/systemd/user/ and creates WantedBy symlinks (no manual systemctl --user enable needed) - Install hook cleans up legacy user-level service files from ~/.config/systemd/user/
This commit is contained in:
parent
1a190ec539
commit
ccc2d163e7
@ -180,11 +180,21 @@ package() {
|
|||||||
install -Dm644 defaults/etc/moongreet/moongreet.toml \
|
install -Dm644 defaults/etc/moongreet/moongreet.toml \
|
||||||
"$pkgdir/usr/share/moonarch/moongreet/moongreet.toml"
|
"$pkgdir/usr/share/moonarch/moongreet/moongreet.toml"
|
||||||
|
|
||||||
|
# --- 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
|
||||||
|
install -dm755 "$pkgdir/etc/systemd/user/graphical-session.target.wants"
|
||||||
|
for svc in defaults/etc/systemd/user/*.service; do
|
||||||
|
ln -sf "../$(basename "$svc")" \
|
||||||
|
"$pkgdir/etc/systemd/user/graphical-session.target.wants/$(basename "$svc")"
|
||||||
|
done
|
||||||
|
|
||||||
# --- User config templates (for post-install.sh / transform.sh) ---
|
# --- User config templates (for post-install.sh / transform.sh) ---
|
||||||
while IFS= read -r -d '' file; do
|
while IFS= read -r -d '' file; do
|
||||||
local _rel="${file#defaults/user/}"
|
local _rel="${file#defaults/user/}"
|
||||||
install -Dm644 "$file" "$pkgdir/usr/share/moonarch/user-defaults/$_rel"
|
install -Dm644 "$file" "$pkgdir/usr/share/moonarch/user-defaults/$_rel"
|
||||||
done < <(find defaults/user -type f -print0)
|
done < <(find defaults/user -type f -print0 2>/dev/null || true)
|
||||||
}
|
}
|
||||||
|
|
||||||
backup=(
|
backup=(
|
||||||
|
|||||||
@ -54,11 +54,15 @@ post_install() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Cleanup legacy user-level paru config (moved to /etc/paru.conf)
|
# Cleanup legacy user-level configs (moved to system-level)
|
||||||
while IFS=: read -r _ _ uid _ _ home _; do
|
while IFS=: read -r _ _ uid _ _ home _; do
|
||||||
if [ "$uid" -ge 1000 ] && [ "$uid" -lt 60000 ] && [ -d "$home" ]; then
|
if [ "$uid" -ge 1000 ] && [ "$uid" -lt 60000 ] && [ -d "$home" ]; then
|
||||||
rm -f "$home/.config/paru/paru.conf" 2>/dev/null || true
|
rm -f "$home/.config/paru/paru.conf" 2>/dev/null || true
|
||||||
rmdir "$home/.config/paru" 2>/dev/null || true
|
rmdir "$home/.config/paru" 2>/dev/null || true
|
||||||
|
for svc in cliphist kanshi nautilus walker; do
|
||||||
|
rm -f "$home/.config/systemd/user/${svc}.service" 2>/dev/null || true
|
||||||
|
rm -f "$home/.config/systemd/user/graphical-session.target.wants/${svc}.service" 2>/dev/null || true
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
done < /etc/passwd
|
done < /etc/passwd
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user