Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have a MacBook Pro that I use in two different 'modes', mobile and desktop.

Mobile is for when I'm using just the MBP with the integrated trackpad, keyboard, and display.
Desktop is for when I'm using it with external displays and an external keyboard and mouse, usually in clamshell mode.

A couple of facts have led me to look for a way to configure a different Dock to appear in each mode:

  1. The resolution of the external displays is higher than that of the internal display, so I have more room for extra apps/folders/spacers in the Dock.
  2. I generally use a different set of main apps in each mode.

So, is there a way to configure two different Docks in OS X and switch between them either automatically based on the presence of an external display or manually?

share|improve this question
    
New open source script: andrebaumeier.github.io/osx-dock-location reacts on desktop width changes and asks for the new position of your dock. Feel free to for and add your logic. –  Serpiente Apr 8 '13 at 4:00
add comment

3 Answers

I found a manual solution, Dock Spaces. It will cost you a little bit under $8, though. Hopefully that's not an issue.

As for automating it, I'm not sure if it is scriptable or not, but it does not have automation like this built-in.

share|improve this answer
add comment

DockSpaces is the answer to your question. DockSpaces allows you to create docks with different applications in each dock. It does not have the automation built in, so I would recommend to you an application that you recommended to me, ControlPlane. You should be able to change docks based on the presence of an external display.

share|improve this answer
add comment
up vote 5 down vote accepted

DockSpaces is nice and convenient, but annoyingly unscriptable. So, I wrote two little shell scripts, one to change to my desktop Dock and one to change to my mobile Dock.

The desktop script is triggered on arrival in my Home context in ControlPlane, and the mobile script is triggered by departure from it.
The desktop context is defined based on the presence of my external displays: enter image description here

Here's how the scripts work:

I save a copy of both Docks in my Documents folder (the Dock configuration is stored in ~/Library/Preferences/com.apple.dock.plist).

When I switch from one to the other, I replace the appropriate file in my Documents folder with the current file in my Preferences so that changes I've made to the Dock are saved. Then I copy the alternate Dock from my Documents to my Preferences. Finally, the Dock process is restarted so that the changes take effect.

The Scripts:

To Desktop:

#!/bin/bash

cp ~/Library/Preferences/com.apple.dock.plist ~/Documents/Docks/mobile.plist
cp ~/Documents/Docks/desktop.plist ~/Library/Preferences/com.apple.dock.plist
killall Dock

To Mobile:

#!/bin/bash

cp ~/Library/Preferences/com.apple.dock.plist ~/Documents/Docks/desktop.plist
cp ~/Documents/Docks/mobile.plist ~/Library/Preferences/com.apple.dock.plist
killall Dock
share|improve this answer
    
Was stuck with Sidekick until today. I'll never look back. –  Cyrille Feb 5 '13 at 20:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.