diff --git a/internal/dock/dock.go b/internal/dock/dock.go index 2822977..492d401 100644 --- a/internal/dock/dock.go +++ b/internal/dock/dock.go @@ -290,7 +290,7 @@ func (p *Plist) Save() error { if err := p.importPlist(tmp.Name()); err != nil { return fmt.Errorf("failed to import plist: %w", err) } - return p.kickstart() + return p.killall() } func (p *Plist) importPlist(path string) error { @@ -309,6 +309,14 @@ func (p *Plist) kickstart() error { return nil } +func (p *Plist) killall() error { + utils.Indent(log.Info, 3)("killing Dock") + if _, err := utils.RunCommand(context.Background(), "/usr/bin/killall", "Dock"); err != nil { + return fmt.Errorf("failed to kill Dock: %v", err) + } + return nil +} + func (p *Plist) AsJSON() ([]byte, error) { return json.MarshalIndent(p, "", " ") }