Recent News

Managing dashboard widgets on various external displays

Like everyone else at Cement Horses, I use a MacBook for daily work, along with an external monitor. When leaving the office, I take the Macbook and leave the monitor, naturally.

Dashboard widgets aren't like ordinary windows -- when I disconnect the external display, the Mac doesn't automatically move them all to the primary display. They simply stay positioned way offscreen, and inaccessible. I can tell you that logging in or restarting doesn't help, and here's the solution I've found.

Widget locations are kept in this plist:


~/Library/Preferences/com.apple.dashboard.plist

If you have Apple's developer tools installed, you can open this in Property List Editor and simply edit each widget's pos-x and pos-y values. (You can just make them zero; as long as they're visible in the Dashboard, you can rearrange them that way.)

screen cap

Once saved, you can reload/activate the plist from the Terminal, like so:


killall Dock

If you switch displays regularly, you can try maintaining separate profiles:

1
2
3
4

~/Library/Preferences/com.apple.dashboard.plist.home
~/Library/Preferences/com.apple.dashboard.plist.work
~/Library/Preferences/com.apple.dashboard.plist.no

A bash function like this one:

1
2
3
4
5
6
7
8
9
10
11
12

resetdash () { 
  if [ $# -ne 2 ] 
  then
    echo "Usage: resetdash [current] [other]"
  echo "Saves your current widget profile, and then activates the profile of your other (specified) setup."
  else
  mv "$HOME/Library/Preferences/com.apple.dashboard.plist" "$HOME/Library/Preferences/com.apple.dashboard.plist.$1"; 
  mv "$HOME/Library/Preferences/com.apple.dashboard.plist.$2" "$HOME/Library/Preferences/com.apple.dashboard.plist";
  killall Dock;
  echo "Widget profile saved and reactivated.";
  fi

Means you can run resetdash work none to change over to your no-external-display profile. (I'm not a pro at bash scripting, so you may have better ideas.)

Comments