EDIT: I have just realized that what I'm talking about isn't a default feature in Lion. I probably added the commands via an article like this (scroll down to "Gestures and keyboard shortcuts"). So this question is more about how to make plist changes take effect immediately from Terminal.
I have spent about 4 hours looking for and developing a solution for a quick way to disable / enable Mission Control. My present line of thinking is:
I can disable the shortcuts to Mission Control, which would give me the same effect.
Oh look, I can disable the shortcuts via ~/Library/Preferences/com.apple.symbolichotkeys.plist
! Let's see how I can modify that…
Darn it, the defaults
command doesn't let me go deep enough into the sub-dictionaries to do what I want. But wait, I found /usr/libexec/PlistBuddy
! Now to write a script…
The script works (it changes the settings in the .plist file), but the changes aren't taking effect.
My questions:
-
Is there a better way to do this?
-
What command can I add to my script to make my changes take effect immediately? You can see I have
killall Dock
in the script, and I've triedkillall Finder
andkillall SystemUIServer
, but none of those seem to work.
Hopefully this is the best place to ask this… I know this is OS-X-specific, but it's also highly technical.
Best Answer
No, there isn't really a better way to force a process to reload its preferences other than killing it. Be careful: a process may flush its preferences when it is killed, so your change may get overwritten.