I have two very similar .desktop launcher files that are to be used as internet shortcuts. When I double click on one file it opens properly in a webbrowser as I would like. When I double click on the other, it opens in a text editor which I do NOT like. How do I change this?
Good shortcut opens in browser:
[Desktop Entry]
Encoding=UTF-8
Name=Safari Books
Type=Link
URL=http://hdl.library.upenn.edu/1017/7026
Icon=text-html
Name[en_US]=Safari Books
Bad shortcut opens in text editor:
[Desktop Entry]
Encoding=UTF-8
Name=Learning Python
Type=Link
URL=http://proquestcombo.safaribooksonline.com/book/programming/python/9780596805395
Icon=text-html
Name[en_US]=Learning Python
I don't have a good solution, but I have a solution. You see, the desktop entry specification does not determine the viewer or mime type for a link. A link can be an image, a document, whatever, and the correct viewer will be chosen based on what the file is. And so it happens that this link opens with an editor (and not a browser). You have two options.
However, here is a little change that will result in the correct behavior, although it is ugly. Modify the desktop entry like this:
It will look the same, but it will be an application launcher. Just remember to set the permissions to execute in that case!