Wednesday, September 02, 2009

KDE Submenu Action For Getting the Public URL of a File in the Dropbox Public Folder

There is yet no equivalent for the nautilus extension for GNOME for KDE, so one can't right click on files in Dropbox's Public folder to get the Public URL. To overcome this limitation, one can use a KDE submenu action. First, create a .desktop file, named dropboxpublic.desktop with the following contents and save it under /usr/share/kde4/services/ServiceMenus or ~/.kde/share/kde4/services/ServiceMenus . The exact location for the parent directory of ServiceMenus is obtained by "kde4-config --path services" output.
[Desktop Action Dropbox Public URL]                                                                                               
Exec=dropbox puburl %u | xclip -selection clipboard                                                                               
Name=Get Public URL

[Desktop Entry]
Actions=Dropbox Public URL;
MimeType=application/octet-stream;
ServiceTypes=KonqPopupMenu/Plugin;
Type=Service
X-KDE-ServiceTypes=KonqPopupMenu/Plugin,
This action requires the xclip program to copy the output of the action to clipboard, so install that using your package manager. Next, when you right click a file in Dropbox/Public folder, and go to Actions-Get Public URL, the URL should be copied to the clipboard. Tip: If you add X-KDE-Priority=TopLevel it will appear in the top level, not under Actions menu.