[SOLVED] How to drag and drop URL link onto launcher
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have tried every argument parameter from %f through %k, but every time I drop a URL directly from the browser onto the launcher, the executeable is never launched. If I first drop the URL onto the Desktop to create a Link, then drop the Link, it receives a Link .desktop file name, instead of the URL inside the desktop link.
Is there anyway to make gnome pass the URL, instead of the desktop file name?
No, %s did not work either. The behavior is the same. A direct drop from the browser never launches the executeable. The drop of the Link substitutes the path to the Links .desktop file.
What if you try to run it in shell? Then it might be along the lines of what I was dealing with, trying to run 'su'. For instance, the Exec might read
Code:
Exec=gnome-terminal|xterm -e 'getvid $1'
or whatever. Then, it may open up. Also, if done that way, it might be a $1 you have to use, since getvid may be $0, the arg...the URL...may be $1; again, this is just advice. Read the man and info pages; they may help a GREAT deal with figuring this out
Where are you putting the launcher? What you're trying to do works for me if the launcher is in the GNOME Panel, but not if the launcher is on the Desktop. Don't know why that is.
The use of 'Terminal=true' isn't required.
I created this on the Desktop, then dragged it on the Panel.
Maybe it is platform specific? I use Fedora 14. I tried moving the launcher to the panel and also setting Terminal=false.
When the launcher is on the panel, the app gets launched when the Link is dropped directly from the browser, but none of the %k, %f or %u parameters are filled in.
I did notice one strange blip. In one of my adjustments, the %u did contain a URL. However, it was never repeated. Maybe there is a cache that needs to be cleared?
I also tried setting mimetypes to accept text/html. Again no luck.
I have confirmed that link the drop from firefox works sometimes. It is really flakey. Sometimes it works if it is the first drop made. Sometimes it will work multiple times then stop and then start again. I cannot find a consistent pattern. %u is expanded to contain the URL of the link that is dropped.
If I drop the link on the Desktop, it creates a Type=Link desktop file. If I drag and drop this link entry onto the launcher, %u is expanded to the path to the link desktop file. The URL key in the link desktop is not used for the substitution.
Where are you putting the launcher? What you're trying to do works for me if the launcher is in the GNOME Panel, but not if the launcher is on the Desktop. Don't know why that is.
The use of 'Terminal=true' isn't required.
I created this on the Desktop, then dragged it on the Panel.
So your clue has solved my problem, but created a newer smaller one.
Yes, if I create a launcher directly on a panel, the drop from the browser works every time. The problem I had previously was that dragging the launcher from the Desktop to the panel seems to affect the setting of the %u parameter. If I do the following it works every time:
right-click on a panel -> Add to Panel...
select Custom Application Launcher
click on ADD
set Type, Name, Command = "command %u", Comment, click OK
So it is now working solidly.
However, I was using the Path= key in the desktop file to preset the working directory for the Exec= script. This key does not seem to work in the panel launcher. I added the key by editing the launcher file in the $HOME/.gnome2/panel2.d/default/launchers directory. No matter what I set the Path= to, the command is launched with the working directory set to my home directory.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.