0

On Ubuntu 12.04 (in Gnome classic mode) I have a Custom Application Launcher that launches a small script, drop_on_me, whenever I drag and drop a URL from the address bar in Firefox or Chrome onto it.¹ I drag the URL by clicking the (Identity) icon next to the URL.

enter image description here

How can achieve the same effect in Linux Mint 17 under Cinnamon, either with an application on the desktop or an applet in the panel?

There doesn't seem to be a simple way to add any existing script just like I have in Ubuntu. When you drag and drop something on a menu/taskbar applet the application doesn't start, so I am not even sure an applet would be the right thing to look for. E.g. when you drag a URL from chrome to the Firefox icon on the taskbar, Firefox doesn't start, let alone start and display the URL dragged on it.

I have looked at extending the context menu when clicking on the address bar, but that would require different implementations for Firefox and Chrome, and that in JavaScript as well.²


The script analyses the URL and takes action based on that. It does handle multiple domains with different actions. E.g. if a stackexchange/stackoverflow URL is dropped on it, a new directory <SE_SITE>_<QUESTION_ID>_<QUESTION_TITLE> is created under ~/src/stackexchange/, which I use as sandbox to experiment with files for a possible answer. An accompanying alias cdsx:

alias cdsx='cd ~/src/stackexchange; cd $(ls -t | head -1)'

gets me to that directory in any open bash shell.


¹You can launch "Add to Panel" with Alt+right mouse click
²Going that route would have the advantage of also being able to handle URLs on a page, without first opening the page and getting the URL in the address bar.

  • This has been one of the things holding me back from switching to Mint from my current, working, work environment. And I think it is the last thing left to do so. – Anthon Oct 17 '14 at 7:50
1

For now I found a workaround in that I just drop the URL on the desktop. A program runs in the background and watches for any .desktop files created there and

  • parses its content to get the URL
  • launches drop_on_me if URL found
  • deletes the .desktop file

This has the advantage that I no longer have to aim for the application icon, and works because I normally don't have permanent "desktop links". It is IMHO not as elegant as the Custom Application Launcher.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.