Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Set per-computer Dock placement System
I have a mobile account set up where my user account synchronises files and settings between my MacBook and my desktop Mac. Since the desktop Mac has a dual monitor setup, I put the Dock in the bottom position, so it's closer to the middle of the two monitors. On the MacBook Pro's widescreen display, though, I prefer the Dock on the left, to give more vertical height for the other windows.

Unfortunately, due to the account synchronisation, whichever preference I set on one Mac automatically gets set to the same value on the other Mac. However, there's a way to solve this with the use of the Mac OS X defaults system.

What is needed is a preference setting which is specific to a certain Mac, which can be synchronised but will not apply to the other one. Technically, we need to set the preference in the preference domain for the current host, rather than for any host, which is the default (For more details, see Apple's docs). This can be done from the command line by giving the -currentHost flag to the defaults command, like so:

defaults -currentHost write orientation bottom

This will write a preference setting specific to the Mac you're working on.

[crarko adds: I haven't tested this one.]
  • Currently 4.11 / 5
  You rated: 1 / 5 (9 votes cast)

Set per-computer Dock placement | 8 comments | Create New Account
Click here to return to the 'Set per-computer Dock placement' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Set per-computer Dock placement
Authored by: zane on Nov 22, '10 07:54:18AM

I hate to be one of those "hey cool" guys without adding value to the conversation, but hey, cool! This hint is rather timely as I've been looking for this precise solution for similar reasons. Will try this out tomorrow. Cheers sigmaris.

[ Reply to This | # ]
Set per-computer Dock placement
Authored by: asmeurer on Nov 22, '10 03:59:34PM
It seems like this hint should have been phrased in a little more generalized way. As far as I can tell, the -currentHost flag can be applied to any defaults write command, i.e., any preference value in Mac OS X. Dock placement is only a very special case of this.

[ Reply to This | # ]
Set per-computer Dock placement
Authored by: stepwallace on Nov 22, '10 05:22:29PM

This looks like it would work for any setting that can be synced. That could be incredibly useful for lots of other applications beyond just the dock...


[ Reply to This | # ]
Set per-computer Dock placement
Authored by: matrixj on Nov 24, '10 06:03:57AM

Slightly off-topic from the intention of the article. Is your desktop Mac a server? How do you create a mobile user account that can sync between two comps without a server?

[ Reply to This | # ]
Set per-computer Dock placement
Authored by: sourdoughjosh on Nov 25, '10 07:51:12AM

This is part of the MobileMe package.

[ Reply to This | # ]
Set per-computer Dock placement
Authored by: matrixj on Nov 29, '10 07:35:47AM

I have MobileMe as well. I've never seen anything about home syncing. I know it has preferences sync, but that doesn't seem to be what people are talking about. I know how mobile profiles work with OS X Server, I've just never seen anything about it with MobileMe.

[ Reply to This | # ]
Set per-computer Dock placement
Authored by: sigmaris on Nov 29, '10 04:19:11PM

The preferences in my home directory get synced because they're stored on a shared file server, basically. I had an OS X Server which was set up to store my home directory, and I set up a mobile account / portable home directory on my Macbook Pro. After a while I realised I could do the same with a Linux server replacing the OS X Server, so that's what I have now.

[ Reply to This | # ]
Set per-computer Dock placement
Authored by: cran on Nov 25, '10 11:13:39PM

Thank you very much for this hint. Looking for this since a while.

I tried to find ways to get a list of available options. So far the best I found is these commands:

  • defaults domains | tr , '\n' (list available preference domains, roughly the list of apps that have settings)
  • defaults find WORD (look for WORD in all settings, e. g. defaults find orientation would find the setting from the hint, among other similar settings)

I also found that zsh has very useful tab completion for the defaults command. If you use zsh and have its completion system configured please try defaults read <TAB> now. Completion even works for keys, so defaults read o<TAB> will complete the orientation setting from the hint.

[ Reply to This | # ]