OS X does a good job of tracking what applications are where and what they do. I have little idea how this works, but if I move VLC.app into a new home then all the files that open in VLC still work. Great. I imagine it involves FSEvents and gobs of XML somewhere.
However the magic doesn’t touch everything. I was so bold as to move Dictionary.app from its default home in /Applications
into the Utilities
subdirectory. This broke the Ctrl-Cmd-D system-wide (Cocoa-wide?) lookup box. I don’t use it that much but that irked me nonetheless.
Console logs included this:
com.apple.launchd[335] (com.apple.DictionaryPanelAgent[490]): posix_spawn("/Applications/Dictionary.app/Contents/SharedSupport/DictionaryPanel.app/Contents/MacOS/DictionaryPanel", ...): No such file or directory
Clearly something thinks it knows where the nested DictionaryPanel application should live. This thing is a launchd
-managed process used by the keyboard shortcut, configured out of /System/Library/LaunchAgents/com.apple.DictionaryPanelAgent.plist
.
The hoojah to tweak this does of course involve XML:
$ launchctl unload /System/Library/LaunchAgents/com.apple.DictionaryPanelAgent.plist
$ plutil -convert xml1 -o - /System/Library/LaunchAgents/com.apple.DictionaryPanelAgent.plist | perl -pe 's|/Applications/Dictionary.app/|/Applications/Utilities/Dictionary.app/|;' > /var/tmp/com.apple.DictionaryPanelAgent.plist
$ plutil -lint /var/tmp/com.apple.DictionaryPanelAgent.plist /var/tmp/com.apple.DictionaryPanelAgent.plist: OK
$ plutil -convert binary1 /var/tmp/com.apple.DictionaryPanelAgent.plist
$ mkdir /Library/LaunchAgents-orig
$ sudo mv /System/Library/LaunchAgents/com.apple.DictionaryPanelAgent.plist /Library/LaunchAgents-orig && sudo cp /var/tmp/com.apple.DictionaryPanelAgent.plist /System/Library/LaunchAgents/com.apple.DictionaryPanelAgent.plist
$ launchctl load /System/Library/LaunchAgents/com.apple.DictionaryPanelAgent.plist
The last step was intended to make the change work this session, but it didn’t work. The DictionaryPanelAgent still loads but didn’t do anything until logged out and in again. I think this is something to do with launchctl
domains / sessiontype. Blunder factor is high.
This violates the “don’t frig with stuff in /System
” principle but I don’t know how else to solve it. The modified plist could go in /Library/LaunchAgents
of course, but I’d still need to disable the system version (with launchctl unload -w
) which is equally naughty. I think.
Tags: OS X, Yak shaving
Leave a Reply
Recent articles
- Docker, SELinux, Consul, Registrator
(Wednesday, 04. 29. 2015 – No Comments) - ZFS performance on FreeBSD
(Tuesday, 09. 16. 2014 – No Comments) - Controlling Exim SMTP behaviour from Dovecot password data
(Wednesday, 09. 3. 2014 – No Comments) - Heartbleed OpenSSL vulnerability
(Tuesday, 04. 8. 2014 – No Comments)
Archives
- April 2015
- September 2014
- April 2014
- September 2013
- August 2013
- March 2013
- April 2012
- March 2012
- September 2011
- June 2011
- February 2011
- January 2011
- October 2010
- September 2010
- February 2010
- September 2009
- August 2009
- January 2009
- September 2008
- August 2008
- July 2008
- May 2008
- April 2008
- February 2008
- January 2008
- November 2007
- October 2007
- September 2007
- August 2007
- December 2006
- November 2006
- August 2006
- June 2006
- May 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005