From c330f96f9c5e740b1952491e39421d7ff9cfc094 Mon Sep 17 00:00:00 2001 From: "Oliver Surke (Gitea)" Date: Tue, 12 May 2026 09:51:34 +0200 Subject: [PATCH] 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 --- bin/ssr-restore | 4 ++++ lib/macos.sh | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/bin/ssr-restore b/bin/ssr-restore index fa55cc9..3b241b6 100755 --- a/bin/ssr-restore +++ b/bin/ssr-restore @@ -96,6 +96,10 @@ ssr::rs::run brew_install "Homebrew install" ssr::brew::ensure_install ssr::rs::run brew_restore "Brew bundle install" ssr::brew::restore "$brewfile" ssr::rs::run mackup_restore "Mackup restore" _ssr_mackup_restore_step +# Restart UI services so Dock/Finder/menubar pick up the plists restored +# by Mackup (com.apple.dock.plist etc.) without requiring a logout. +ssr::macos::restart_ui + ssr::rs::run macos_defaults "macOS defaults" ssr::macos::apply_defaults if [[ "${SSR_SNAPSHOT_MACOS_PREFS:-true}" == "true" ]]; then diff --git a/lib/macos.sh b/lib/macos.sh index fe55f7d..ef40536 100644 --- a/lib/macos.sh +++ b/lib/macos.sh @@ -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