Archive for April, 2012

I am one of the [many] happy users of Dropbox. I use it to synchronize my files, primarily those related my work and my PhD thesis, between home and lab computers. So far, Dropbox has proved to be a quick, light and flawless tool.

There’s one thing that annoyed me every time I stumbled upon it — it’s the behavior of the “Open Dropbox Folder” menu item. I assume that a click on this item, or just on the Dropbox icon in the tray, should open the local Dropbox folder in the system-specific file manager. In reality it opens a web browser and there’s no obvious way to change this. Maybe this feature works correctly under Gnome, since the dropbox package contains Nautilus extensions. I don’t use Gnome and don’t have Nautilus installed to check this. Instead, I use Trinity desktop and I want my Dropbox folder opened in Konqueror. A bit of googling and observation revealed the solution.

First of all, I wanted to know how the dropbox daemon chooses a browser. It turned out that, when the daemon needs to open a browser, it looks at the system preference for “x-www-browser”. This means that dropbox opens a browser that /etc/alternatives/x-browser symlink points to. In my case it was Chromium. Changing the system preference by issuingsudo update-alternatives --config x-www-browser
resulted in a desired browser being launched. Well, it’s better now, but still far from what I wanted.

When the daemon is launched from a terminal, a click on the “Open Dropbox Folder” sends a message back to the terminal:Warning: unknown mime-type for "/home/vitalie/Dropbox" -- using "application/octet-stream"
Error: no "view" mailcap rules found for type "application/octet-stream"
No applications found for mimetype: inode/directory
Aha, so dropbox first looks for an application to handle directories and then, if nothing is found, resorts to browsers! Very well, now I have to figure out how to assign this inode/directory mimetype to Konqueror.

Mimetypes (what does it mean, by the way?) are assigned by issuing something like xdg-mime default application_name.desktop mimetype_name. In my case it wasxdg-mime default konqueror.desktop inode/directory
Now a click on “Open Dropbox Folder” opens my local Dropbox folder in Konqueror.

P.S.: I worked only after I copied the konqueror.desktop file from /opt/trinity/share/applink to ~/.local/share/applications.
P.P.S.: It would probably be easier to edit file associations in Trinity Control Center, aka Kcontrol.