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.
This commit is contained in:
parent
797037c2d9
commit
8e2fb5a9f5
@ -190,6 +190,14 @@ package() {
|
||||
"$pkgdir/etc/systemd/user/graphical-session.target.wants/$(basename "$svc")"
|
||||
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=(
|
||||
|
||||
@ -71,6 +71,12 @@ post_install() {
|
||||
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
|
||||
|
||||
# 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 "==> For first-time setup run: /opt/moonarch/scripts/post-install.sh"
|
||||
echo "==> This enables services and configures firewall."
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user