Problem Description: Creating a desktop folder with executable programs in it
I find Libre Office to be an excellent collection of office applications but it causes me slight frustration due to how it behaves on my system. I guess I’m just used to launching word or excel or powerpoint in windows directly and not using a pre-launch app selector for which program I’m after.
In fact, I prefer to do this with most apps. For example, I like to create a desktop folder named Finance where any relative program, HTML links, doc files and spreadsheets that relate to finances reside. Same for Music.
I’m having great difficulty doing this with Ubuntu and Gnome. I can’t find a way to ‘move’ or ‘copy’ or ‘drag n drop’ an application (or link that works) to a desktop folder. Most of the times I copy or move an HTML link into the folder it doesn’t run, I just get a text file showing what’s in the file, like this:
<meta http-equiv="refresh" content="0; url=https://www.my-portfolio.ca/pcis/login.jsp </head> <body> </body> </html>
</blockquote>
<p>Sorry for pressing on my old Windows habits after moving to Linux but these have become extremely useful and comfortable for me.</p>
For historical reasons Gnome doesn’t do desktop icons without some extensions to do it installed. It used to do them and like a lot of other desktops it was the job of the file manager to display and manipulate them – that’s not as strange as you might think it is, the desktop is basically an undecorated transparent file manager window in icon mode; in Windows it’s was done that way too (haven’t used that in a while, so I don’t know if they still do it like that) and XFCE, KDE, and LXDE do it that way to. At some point the code to do it hadn’t been touched in years and when they where working on nautilus for the newest iteration of Gnome they decided to take that code out and write a separate desktop icon handling program at some later time. That time hasn’t come yet and so there are multiple extensions to do that job and one of them is installed on Ubuntu by default. Since it’s an extension and not a core part of Gnome the integration is not as seamless as one would like.
Desktop icons are actually small text files with the extension ‘.desktop’. They have a syntax similar to an *.ini file if you remember those. A full description of these files can be found at https://specifications.freedesktop.org/desktop-entry/latest/. While it is quite possible to write those files by hand, there are a couple of shortcuts you can take. For one thing you already have .desktop files for a lot of the programs on your system in /usr/share/applications, Simply copy the desktop file you want from there to the desktop directory, make the file executable and it should work. There also are several specialised GUI tools for creating desktop files - alacarte and menulibre are the ones I have used.
Links to web pages are a special case. They are also done with .desktop files but they have a line saying ‘Type=Link’ instead of ‘Type=Application’. In XFCE I can simply drag and drop the contents of the address bar to the desktop. I believe it used to work like that in Gnome, too but I don’t think it does anymore. You will probably have to write those desktop files by hand. An example to help you along:
[Desktop Entry]
Version=1.0
Type=Link
Name=How to create desktop folder containing launchable programs (Libre Office) and HTML links - Support and Help - Ubuntu Community Hub
Comment=
Icon=user-bookmarks
URL=https://discourse.ubuntu.com/t/how-to-create-desktop-folder-containing-launchable-programs-libre-office-and-html-links/78265
A file with this content and a name ending in .desktop would give you a link to this very page.
PS: Are there no separate Launchers for the various parts of Libre Office included in main line Ubuntu ? On my system there are. It’s actually not all the problematic to create such shortcuts, simply have an ‘Exec=’ line that calls ‘libreoffice’ with one of the options ‘--writer’, ‘--calc’, ‘--impress’, ‘--base’, ‘--draw’, or ‘--math’ …
Thank you hdd-gehrke for such a complete and helpful response. Just reading your message motivates me once again to get a handle on this (I’d been ignoring the annoyance because my searches for a solution hadn’t been coming up with anything). I was leary about posting here as I’m a newbie to Ubuntu and Gnome and worry people will tire of my ‘simple’ questions.
There is still much about Linux and Ubuntu (and for the most part Gnome) I’m quite impressed with.
I mess around with music a lot and was worried about losing certain Windows apps I had acquired for creating and manipulating sound however I was blown away with the stuff available for Linux.
Interesting. No matter what I do I cannot get Gnome to launch a .desktop URL link. I read and followed the v1.5 spec you provided (pretty straight forward) and a double click on a properly laid out .desktop file does absolutely nothing (Type=Link, etc…).
What DOES seem to work as a URL shortcut in my version of Gnome are files with a .html extension. Below is an example of what works (file named Flight Radar.html). Next I’ll work on getting a program shortcut to work.
<html>
<!-- This shortcut links to a web site that shows all active airplanes in flight -->
<head>
<meta http-equiv="refresh" content="0; url=https://www.flightradar24.com/42.83,-80.60/9" />
</head>
<body>
</body>
</html>
Nautilus prohibits launching .desktop files from the Desktop unless you right-click on the file first and select, “Allow Launching” if I’m understanding your issue correctly.
You should also be aware that a while back nautilus removed support for Type=Link desktop files for security reasons. It only supports Type=Application now.
So you’ll need to redo your desktop file to a Type=Application and use “Exec=” to launch an application with the specified URL as an argument, e.g,
Where is the .desktop file located? And post the contents of the .desktop file. It’s necessary to get the Exec= line syntactically correct or it just won’t launch. It also doesn’t give an error message as to why it fails, either.
ian-weisser > Why can’t you simply put your applications on the Gnome desktop’s Shortcut Bar, which is there for that purpose?
I could do that and thought about doing it however then I have what I consider way too many icons there. Also, they aren’t grouped into a folder of Finance or Music or Home Controller or Coding along with other related files that might be docs, websites, spreadsheets etc…
Well, the .desktop file should be located in ~/Desktop in order for the right-click→Allow Launching to appear in the right context menu. And it also requires Type=Application and a syntactically correct Exec= line to work as well. It’s kinda finicky.
If you’ve done all the above and it still doesn’t work, then post the contents of the desktop file and we can take a look at it.