Easily get Public Link for Dropbox Files in Linux

I got tired of going to the dropbox website to find the public link for files I put in the Public folder.  On Windows you can simply right click–>get Public link, but I’m running LinuxMint with Dropbox version 2.0.22 which doesn’t support this (among many other things like Pausing a sync…)

Anyway I wrote a script that you can just drag your files onto and it’ll pop up a box showing you the public link.  In Linux, a script alone can’t do this, but a script and a .desktop file can call a script to do it.  Here’s what I got:

Save the following in a text file called “getPublicLink.sh” inside your Dropbox/Public folder.  Make sure it has permission to run (right-click the file–> properties –>permission and check the box to allow it to run)

#!/bin/bash
publicLink=$(dropbox puburl $1)
zenity --info --text $publicLink

Now create a new text file named “Get Public Dropbox Link”.  Paste the following there, be sure to change your username, mine says “adam” yours does not and this will make it not work. Save it in the Dropbox/Public folder and give it permission to execute as well. Here’s the file:

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=/home/adam/Dropbox/Public/getPublicLink.sh
Name=My Application
Icon=/usr/share/icons/hicolor/48x48/status/aptdaemon-update-cache.png
#Required for double-click running and Drag-andDrop files into this icon.
#reference: http://linuxcritic.wordpress.com/2010/04/07/anatomy-of-a-desktop-file/
Name[en_US]=Get Public Dropbox Link

 

Now you can  simply drag files from your public folder on top of the “Get Public Dropbox Link” file and a window will pop up showing you the public link. from here, simply copy and paste that link to where ever you need.

Information_903

 

Adam-Atom

3 thoughts on “Easily get Public Link for Dropbox Files in Linux”

  1. Just amazing that we’d have to go through these hoops to get Dropbox to work as well in Linux as in Windows! This should have been easy to accomplish right at the git-go. Many thanks for your help in rectifying this needless shortcoming.

  2. Need to explicitly save the second file with a “.desktop” extension. Also the script needs some tweaking to tolerate filenames with spaces. Thanks for saving
    me a reboot.

    Mike

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.