How to drag a url to a .desktop shortcut

2.3k views Asked by At

I have created a new .desktop shortcut in LXDE, and added that shortcut to the "Application Launch Bar". I can drag a file onto the shortcut, and the filename will be passed to a script successfully. However, when I drag a link from either Firefox or Chrome, the link is not passed as an argument.

The important parts of my .desktop file are as follows:

[Desktop Entry]
Exec=/bin/bash /home/myUserName/test.sh %u
Terminal=false
StartupNotify=true

And /home/myUserName/test.sh simply contains:

echo "!$1!" > /home/myUserName/test.txt

just to prove that it's passing arguments.

I've read the freedesktop standards. I had only Chrome installed when I discovered the problem, but I read that chrome was saving files instead of links, so I switched to Firefox; however the URL is still not passing to the desktop shortcut.

I hope I'm overlooking something, as this seems to be a huge gap in continuity with freedesktop standards.

Any suggestions?

EDIT: After testing, Firefox saves an HTML file instead of a link just like Chrome, so it appears to be an LXDE bug rather than a browser bug. I'll assume that my next endeavor is to find out why.

1

There are 1 answers

0
alfadog67 On BEST ANSWER

I've not completely absorbed the delineation between a window manager and a desktop manager, but I believe that LXDE is the culprit, either directly or indirectly, in conjunction with pcmanfm.

I've read that installing pcmanfm-mod might solve my problem, and I've also read that pcmanfm is no longer being developed, and is replaced by spacefm, which is out of my scope to install right now, as it is not available in my distribution.

To bottom-line it, XFCE with Thunar has solved the problem. I added a "Launcher" to my newly-installed XFCE-Panel, and its EXEC is identical to the one in the original post, and the %u is now successfully passed to my script when I drag a link from Firefox. I have not tried to drag a link from Chrome, but I feel it would work as well.