Add moonarch-git and sweet-cursors-git PKGBUILDs
moonarch-git packages all desktop environment defaults (XDG configs, helper scripts, zsh config, wallpaper) for pacman-managed deployment. Includes moonarch-update for simplified system maintenance. sweet-cursors-git packages the Sweet cursor theme separately.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# ABOUTME: Post-install hooks for moonarch-git package.
|
||||
# ABOUTME: Handles zsh integration and configs owned by other packages.
|
||||
|
||||
post_install() {
|
||||
# Zsh integration: source moonarch defaults for users without ~/.zshrc
|
||||
if ! grep -q "zshrc.moonarch" /etc/zsh/zshrc 2>/dev/null; then
|
||||
echo '# Moonarch defaults (overridden by ~/.zshrc)' >> /etc/zsh/zshrc
|
||||
echo '[[ ! -f "$HOME/.zshrc" ]] && source /etc/zsh/zshrc.moonarch' >> /etc/zsh/zshrc
|
||||
fi
|
||||
|
||||
# Deploy greetd config (file owned by greetd package, overwrite deliberately)
|
||||
if [ -d /etc/greetd ]; then
|
||||
cp /usr/share/moonarch/greetd/config.toml /etc/greetd/config.toml
|
||||
cp /usr/share/moonarch/greetd/niri-greeter.kdl /etc/greetd/niri-greeter.kdl
|
||||
fi
|
||||
|
||||
# Deploy moongreet config (file owned by moongreet-git, overwrite deliberately)
|
||||
if [ -d /etc/moongreet ]; then
|
||||
cp /usr/share/moonarch/moongreet/moongreet.toml /etc/moongreet/moongreet.toml
|
||||
fi
|
||||
|
||||
# Cleanup legacy /usr/local/bin/ scripts from pre-package installs
|
||||
rm -f /usr/local/bin/moonarch-* 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
|
||||
|
||||
echo "==> Moonarch defaults installed."
|
||||
echo "==> For first-time setup run: /opt/moonarch/scripts/post-install.sh"
|
||||
echo "==> This enables services, configures firewall, and sets up user defaults."
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
post_install
|
||||
}
|
||||
Reference in New Issue
Block a user