[MMUG] Running two Dropboxes

8 views
Skip to first unread message

Marc Carter

unread,
Jan 2, 2010, 2:03:20 PM1/2/10
to mmug...@googlegroups.com
Dropbox has this page - http://wiki.dropbox.com/TipsAndTricks/MultipleInstancesOnUnix - about running two copies of Dropbox on one machine.  


I have done this first part:

General idea

The basic idea is to just start Dropbox from the command-line using an alternate home-dir. This will create another Dropbox icon, and another Dropbox folder, which has to be in some other place from the original one. One way to distinguish the two menu bar icons is to change one to Leopard style (black and white) in its Preferences. The two Dropbox folders will both be called Dropbox (this cannot be changed), but you can distinguish them by their location, precisely. Each instance can be used with a different Dropbox account. For instance, I have a personnal Dropbox account and one for professional use. On my laptop, there are separated on two different user accounts, but at home, I would like both on the same user account. Hence, at home, I use the trick below. Technically speaking, this trick could be made an unlimited number of times.


Set it up on Mac OS X

Launch /Applications/Utilities/Terminal.app. Make sure you are running a "bash" shell. If needed, just type (do not include the dollar sign—that indicates the command prompt):

$ bash

Then paste the following command:

$ HOME=$HOME/.dropbox-alt /Applications/Dropbox.app/Contents/MacOS/Dropbox &

Now, you should entering a new Dropbox setup wizard window. A second Dropbox icon should appear on the status bar. Choose an existing account if you have one (different from the original one!) or create a new one. Make sure you choose an alternate location for your new Dropbox folder. If you quit the terminal, the new alternate Dropbox process will also quit. But do not worry! It is set up, and the remaining part of the trick below explains how to restart it with a dedicated little app bundle.




But I get stuck on this next part.  It doesn't create the 3 folders, it just creates the 'DropboxAltStarter.app' which I can't do anything with (it says its not supported on this architecture).  I'm running 10.5.8 so it should be fine, I think the point is its not meant to be run at that stage, I'm meant to use the folder as it says.

I also can't save the code in textedit, it won't let me save it as a .plist file.  

Any ideas?  Its all written a bit technically, I have got myself a bit confused!




Start automatically on login on Mac OS X

In order to run the second instance automatically on login, you'll have to create a small app bundle, which you will later add to startup items in the System Preferences "Accounts" pane. Starts by pasting the following command into Terminal. Again, do not include the initial dollar sign of each block:

$ mkdir -p ~/<whaveter place you like>/DropboxAltStarter.app/Contents/MacOS/

This will create recursively, if they do not exist, the folders "DropboxAltStarter.app", "Contents" and "MacOS". If you change the name "DropboxAltStarter" for something else, make sure you change it everywhere relevant in the next lines.

Now, open a text editor, and paste the following code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleExecutable</key>
    <string>DropboxAltStarter</string>
    <key>LSUIElement</key>
    <string>1</string>
</dict>
</plist>

And save it with the name "Info.plist" (this is crucial, do not choose another name) and save the file inside "DropboxAltStarter.app/Contents"! Now, open a new text file in the text editor, and paste the following text (warning: make sure you remove the leading whitespaces - I had to put one because of wiki formating):

 #!/bin/bash
 HOME=/Users/$USER/.dropbox-alt /Applications/Dropbox.app/Contents/MacOS/Dropbox

and save it with the same name as specified in the Info.plist file (i.e. look at the string just below "<key>CFBundleExecutable</key>"). And save the file inside "DropboxAltStarter.app/Contents/MacOS"! (Yes, with "MacOS" this time). You can close your text editor.

Make sure that your script is executable, by typing the following command in a terminal:

$ chmod 755 ~/<whatever place you like>/DropboxAltStarter.app/Contents/MacOS/DropboxAltStarter

Now, in the "<whaveter place you like>" directory, you have a small Mas OS X app bundle. You can add it to your login items in the System Preferences->Accounts. You can also double-click on it everytime you need to start this second instance of Dropbox (i.e. if it crashed).




Drew Reece

unread,
Jan 2, 2010, 5:04:06 PM1/2/10
to mmug...@googlegroups.com
Marc,
Try TextMate for the plist & script, or Plist Editor in the Apple Developer tools (on OSX install DVD).

Are you on PPC or Intel? I suspect the architecture error is a red herring, due to the state of the bundle (no info.plist). 
Can you "Show package contents" (right click in Finder) on the generated copy of the Dropbox.app? You could try 'cd /place-that/copy/exists/dropbox-alt.app' and then do the 'mkdir -p Contents/MacOS'. Check with 'ls -l' if the folders are there, a 'd' at the start indicates a folder.

Just a thought…
It may be is easier to duplicate the dropbox.app & do the Info.plist modifications there, I'm not sure if there are other identifiers to alter though to make a 'new app'. From what I can tell it is just changing the application identifier to gain a new set of preferences, the script opens a new instance of Dropbox.app. Their method means only one set of code needs to be managed, the original Dropbox.app.

Try coping the duplicated & edited Info.plist to the older dropbox-alt.app

eg in Terminal
cp /path/to/dropbox-duplicate.app/Contents/Info.plist /path/to/dropbox-alt.app/Contents/Info.plist

Post back if it's just gobbledygook, Finder should do most of the tasks anyway :^)

Re:co

--
MMUG is an  Apple User Group.
You received this message because you are subscribed to the "MMUG Chat" group. To post to the group, send email to mmug...@googlegroups.com. To unsubscribe, send email to mmug-chat-...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/mmug-chat. Please note that what you post to the list is publicly readable by anyone and regularly indexed by search engines.

Reply all
Reply to author
Forward
0 new messages