Skip to content

Commit

Permalink
fix: dock restart for macOS 14.4+ #65
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Jun 7, 2024
1 parent 3f99431 commit 0645882
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/dock/dock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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, "", " ")
}

0 comments on commit 0645882

Please sign in to comment.