Has a way to create a program shortcut on the desktop entirely from the terminal / CLI (scriptable) been discovered in Ubuntu 20.04?
I can copy in .desktop files from /usr/share/applications/, and set them as executable, but apparently that's no longer enough. There is now a final step:
Right-click the shortcut -> Select Allow Launching.
Until that is done, double-clicking it simply opens the .desktop file as a text file, rather than execute the program. Furthermore before that step, the icon is the generic shell script icon, rather than the program's own icon.
...and I don't yet know how to do that step from the terminal.
Any help is appreciated - thank you.
My own investigations:
Allow Launching does set the script as executable, but doing that manually is not enough.
Also from my investigation it doesn't alter the .desktop file itself, and no changes are made that are visible to ls -l or lsattr, so I'm assuming it's some other database of sorts, that tracks which shortcuts it's allowed to launch and which it isn't?
Considered solutions:
gnome-desktop-item-editcan't do it, and it also no longer exists in recent versions of Ubuntu.alacarteI'm unsure about, but regardless it's GUI only.desktop-file-install/desktop-file-editI'm unsure about.
Allow launchingfixes), but the idea of creating the file association between.desktopandgtk-launchis interesting, I'll try that out. But there must be a way of performing thatAllow launchingaction from the terminal somehow. Another way of showing the right icon would also be useful though. – miyalys Feb 09 '21 at 11:03dconf, but again, could be another dead end.gnome-shellmust do a lookup in some kind of database, and maybe a way to modify that can be found. – miyalys Mar 18 '21 at 19:03gnome-desktop-item-editused to be a part ofgnome-paneland it can be downloaded from e.g. the Ubuntu 18.04 repository, and once you also get the library it depends on -libgnome-desktopyou can unpack both and launch it even in 20.10 like this:LD_LIBRARY_PATH="~/Downloads/libgnome-desktop-3-17_3.28.2-0ubuntu1.3_amd64/usr/lib/x86_64-linux-gnu" ./gnome-desktop-item-edit ~/Desktop/ --create-new...BUT there's little point, because it's still not launchable, so it was a dead end. See Hasan's answer instead! – miyalys Mar 23 '21 at 18:49