Update Dock after defaults write without `killall` restart

defaultsdockmission-control

I'm toggling a Mission Control setting with defaults write but the Dock doesn't see the change without restarting via killall Dock. How can I get the Dock to read the updated plist settings without killing it?

The setting is stored in the com.apple.dock plist, this is the command to update it (toggling the boolean):

defaults write com.apple.dock expose-group-apps -bool FALSE

Ideally, I want to use this command to quickly change the setting so I can use both window grouping modes with Mission Control, but restarting the dock is slow and disruptive, usually expanding any application windows minimized into the Dock. Is there some sort of notification/ping I can use to alert the Dock to its new settings?

Best Answer

Send the Dock process a signal called the 'hang-up' or HUP, also known as signal number 1 as defined somewhere in a system signals.h header file. POSIX convention, I believe.

The quick and dirty:

sudo pkill -1 Dock

What a HUP signal should effectuate in the receiving process is an internal halt and re-evaluation, which usually includes a re-reading of any relevant config files. The process will not terminate, only 'refresh' itself.

Hope this helps.

F.