2011. november 1., kedd

Multiple DropBox accounts for one user on Ubuntu

I like the DropBox, but I have separate personal and work accounts. The old trick does not work any more, but after some tweaking I was able to set up two accounts in KDE/Ubuntu. How it works: for a secondary DropBox account, a "fake" home directory is needed for a "fake" user (-> it is not needed to create new users on the system). Here are the (not so exact) steps:

REPLACE the "USER_NAME" to your own user name in Ubuntu in the commands!!

(0. Create two DropBox accounts.)
1. Install the DropBox client on Ubuntu, start and setup an account.
2. Disable the automatic start in the Dropbox settings and close the sync client from the system tray.
3. Create a new "fake" home directory for your DropBox account:
sudo mkdir /home/USER_NAME-dropbox
4. Give your permissions to the directory:
sudo chown USER_NAME:USER_NAME /home/USER_NAME-dropbox
5. Copy the ~/.dropbox-dist to the new "fake" home directory:
cp ~/.dropbox-dist /home/USER_NAME-dropbox
6. Move the current DropBox user settings to the "fake" home dir:
mv ~/.dropbox /home/USER_NAME-dropbox
7. Create symlinks to the .kde and .config directories:
ln -s /home/USER_NAME/.config /home/USER_NAME-dropbox/.config
ln -s /home/USER_NAME/.kde /home/USER_NAME-dropbox/.kde

9. Start the Dropbox client again, setup the secondary account and disable the automatic start in the settings again.
10. Create a bash script somewhere to start two DropBox clients (don't forget to add executable permission!):
# First client
~/.dropbox-dist/dropboxd 2> /dev/null &
# Secondary client
USER="$USER-dropbox"
HOME="/home/$USER"
$HOME/.dropbox-dist/dropboxd 2> /dev/null &
10. In KDE: Go to System Settings/Startup and Shutdown. In the Autostart menu, add the freshly created bash script to start the client on computer startup.
(11. It is a good practice to change the icon colors in one of the ".dropbox-dist/icons/hicolor/16x16" directories to distinguish the clients in the system tray.)

Probably, there are nicer ways, but it works for me. Using the same principles, any number of clients can be run under the same user account.

Nincsenek megjegyzések: