post_install() {
    systemctl daemon-reload

    # Enable and start system monitor service
    systemctl enable --now update-notifier-monitor.service

    echo "==> Update Notifier Qt services configured"
    echo "==> System monitor is running"
    echo "==> Tray icon will auto-start for all users on login"
}

post_upgrade() {
    systemctl daemon-reload

    # Restart only if already running
    systemctl try-restart update-notifier-monitor.service
}

pre_remove() {
    # Stop system monitor service before removal
    systemctl stop update-notifier-monitor.service 2>/dev/null || true
}

post_remove() {
    systemctl daemon-reload
}
