I'm using Ubuntu Mate 21.04 with much pleasure. I would like to put an URL on my desktop in order to open an often used website. Has anyone an idea ? With the "New Starter" app i did not have succes.
Thanks for helping out
Right click desktop, create launcher, use firefox %u http://"your url" for your command line
Yes Jaybo, your command line was the solution.
Thanks a lot for your help, it works !
What's the %u for?
I remember seeing it in an example at some point, but never actually bothered using it (I think **) and apparently never needed it.
** This was on my HTPC, so I set up shortcuts for Hulu, HBO, CR, etc, differentiated by icon so I didn't have to read 10pt text at 10'. But that was years ago, so maybe I'm just remembering it wrong.
I have no idea only that it works for me and I never experimented differently.
The %u
stands as a placeholder for the URI in question to be inserted into the command line. If the %u
is not present, then the application launching the launcher will append the URI to the end of the command line; generally speaking, appending the URI to the end of the command line is enough. However, there are a few applications (such as ffmpeg
) which require you to specify URIs and options in a specific order. I use a launcher like this on my desktop to quickly convert video files to AVI format (somebody I know can play only AVI files on their computer):
ffmpeg -i %u -f avi converted.avi
Right, but the whole point of this case is that there IS no URI to be inserted: it's already there, explicitly, in the command line. Ergo, in this context, the %u is actually incorrect. That's where I was going with that comment.
Not to be pedantic, but the %u
is not "incorrect" per se; it is only unnecessary. If there is no URI to be inserted, then the %u
is replaced with nothing; the most you get is an extra space in between the command firefox
and the fixed URL http://[...]
. Type an extra space between the command and its parameters into a shell, and you'll see that the shell just ignored the duplicate space.
Another interesting side note: @jaybo's solution with the %u
in the launcher command line string actually operates differently than if the %u
were left off -- at least, if you were to drag-and-drop a Web page link, for example, onto the launcher. @jaybo's solution would open a tab for the URI dragged onto the launcher first, and then open the fixed URI in the launcher command line last. The normal behavior would be to open the fixed URI first and the dragged URI last. So yes, the %u
is unnecessary and changes the semantics slightly, but you can't really say it's an incorrect solution since you don't know exactly what the OP's precise goals are.
All right. That's enough of me blabber-mouthing diatribe endlessly about the semantics of the XDG %u
format specifier.
Agreed: "unnecessary" would be a better term.
That said, I don't think "incorrect" is necessarily wrong: while the extra %u isn't harmful from the computer side, it does - as shown here - add confusion and complexity to the human side for no reason, and I would suggest really doesn't belong there at all for "targeted" links like this case.
Not to be pedantic
meh. I think that since you're also adding more information, you're really just being that - i.e. informative - more than pedantic.