fix: restart Dock/Finder/SystemUIServer after mackup restore

Mackup restores com.apple.dock.plist and other UI preference files, but
the running Dock/Finder processes don't reload them automatically. Add
ssr::macos::restart_ui (killall cfprefsd Dock Finder SystemUIServer + 2s
settle) called immediately after the mackup restore step so the Dock
layout and Finder settings take effect without requiring a logout.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-12 09:51:34 +02:00
parent 488a9a2140
commit c330f96f9c
2 changed files with 17 additions and 0 deletions
+13
View File
@@ -33,6 +33,19 @@ ssr::macos::disable_gatekeeper() {
sudo spctl --global-disable
}
# Restart macOS UI services that read preference files restored by Mackup.
# Called after mackup restore so Dock/Finder/menubar pick up the new plists.
ssr::macos::restart_ui() {
ssr::log "Restarting UI services (Dock, Finder, SystemUIServer, cfprefsd)"
local svc
for svc in cfprefsd Dock Finder SystemUIServer; do
killall "$svc" 2>/dev/null || true
done
# Brief pause so cfprefsd flushes its cache before Dock re-reads prefs.
sleep 2
ssr::ok "UI services restarted — Dock and Finder will refresh."
}
ssr::macos::open_installed_casks() {
[[ "${SSR_OPEN_CASKS:-false}" == "true" ]] || return 0
local cask_dir