Can I enable hiding the dock on my MacBook monitor only?
Solution 1:
I was able to use the previously suggested ControlPlane app along with some simple shell scripts to get this working.
First, I created a context for having my Thunderbolt Display plugged in ("Desk"), and one that negated that choice ("Lap"). Next, I made two simple shell scripts to toggle the autohide setting and restart the Dock. I put them in a .controlplane
directory in my home folder.
~/.controlplane/dock-hiding-on.sh
defaults write com.apple.dock autohide -bool true && killall Dock
~/.controlplane/dock-hiding-off.sh
defaults write com.apple.dock autohide -bool false && killall Dock
I then set those files to be executable.
Lastly, I set the correct script to run for the appropriate ControlPlane context. (Note: I had to show hidden files in the dialog with "⌘+⇧+.")
Solution 2:
Applications like Sidekick or ControlPlane allow you to change settings (network, desktop picture, custom terminal actions) based on location evidences (geolocation, attached devices...etc). I'm sure you will be able to use one of those to detect you are at your desk with your 27" plugged in and run a command disabling auto-hide.