Saturday 5 September 2009

Installing Dropbox in Arch

There is this really useful bit of software called Dropbox, which syncs a directory on your machine with a network server and your other machines. It also handles version control and backups. It runs on XP and Linux and as such is very useful.

On Ubuntu it will install perfectly happily, but on other distributions it takes a little bit more work. The following instructions work for Arch running the LXDE desktop.

Step One.
Download the Linux version from here. Then extract the contents into your home, or ~/ folder. The contents should just be a folder called .dropbox-dist.

Step Two.
Download two command line utilities to setup the non-ubuntu version by running these commands in terminal:
wget http://dl.getdropbox.com/u/6995/dbmakefakelib.py
wget http://dl.getdropbox.com/u/6995/dbreadconfig.py
Step Three.
Make a folder in your home directory to store the files being shared by running this command in terminal:
mkdir ~/Dropbox 
Step Four.
Run the two scripts that you downloaded earlier to get an ID code for the machine that you are using. The first script test runs Dropbox to generate the local databases with your host_id. If the dropbox program pops up, just ignore it. It will be have quite flakily. Rely on the command line, it will tell you when 15 seconds have passed. Just close dropbox at that stage, and run the next command. If you get any error codes when running the first command, try running it whenyou are offline - i.e. disconnect from the internet.
python dbmakefakelib.py
python dbreadconfig.py
Copy the host_id from the subsequent text output.

Step Five.
Open a browser window and use this link (where HOSTID is the host_id you copied in the previous step):
https://www.getdropbox.com/cli_link?host_id=HOSTID
Log in with your user name and password.

Step Six.
Desktops which follow the free desktop system store information for their application menus in .desktop files which are then automatically assembled into a menu structure. You need to setup a menu icon for Dropbox by running the following command in terminal (you NEED to make sure to change the USER below to the name of your user account):
echo '[Desktop Entry]
Name=Dropbox
GenericName=Network Storage
Comment=Secure backup, sync and sharing made easy
Exec=/home/USER/.dropbox-dist/dropboxd
Icon=/usr/share/pixmaps/dropbox.png
Terminal=false
Type=Application
Categories=Network;' | sudo tee -a /usr/share/applications/dropbox.desktop
That command will make a new file in /usr/share/applications/ called dropbox.desktop. That's the folder which LXDE uses. Other distributions and Desktop Environments may vary. You will find icons for all other installed applications in the same folder. Important note - installing the .desktop folder here will make the application appear in all users menus. It is possible to install it to a personal folder in home, which may be preferable.

Step Seven.
To make it look nice you will need an icon, which you can get and copy to the right place by running these commands:
wget http://aur.archlinux.org/packages/dropbox/dropbox/dropbox.png
sudo mv ./dropbox.png /usr/share/pixmaps/dropbox.png
Step Eight.
You will want Dropbox to run when your user logs in, so that it is available automatically. The free desktop model makes provision for this and you can set it up by running these commands:
mkdir  ~/.config/autostart
cp /usr/share/applications/dropbox.desktop ~/.config/autostart/
The first command [m]a[k]es a [dir]ectory in your home (~) folder called config with another folder inside called autostart. The [.] before config means the folder is hidden.
The second command [c]o[p]ies the desktop file we made in Step Six to the autostart folder, causing it to be run when the user owning the home directory logs in.

Step Nine.
You can now run Dropbox from the menu, where an Icon has magically appeared, or restart your machine. All the configuration of the client should have been achieved by Step Five, so it should start syncing right away.

1 comment:

  1. Thanks for the HOWTO. I just started using LXDE with Arch on my Samsung NC10. Dropbox is nice for keeping stuff off my slow netbook and up in the cloud.

    ReplyDelete