Trying to recover a bunch of .desktop
files from Ubuntu 14.04 copied to 16.04, but they don't appear in the Launcher.
Did the following (/14.04
is mounted to the old Ubuntu disk / FS)
cd ~/.local/share/applications
cp -pr /14.04/home/ring0/.local/share/applications/[bunch-of].desktop .
but they do no appear after logging back to 16.04. (same user / uid on both versions)
Had a look at /usr/share/applications
, but the files are in the .local
dir.
Looking at the structure of the .desktop
files on both versions, they look similar.
Anything else to check / setup?
Thanks
You need to manually add it to Unity Launcher, it's not enough to just put it in the folder.
browse to your
.local/share/applications
folder in Nautilus (the folder might be hidden, so you might need to press Ctrl+H)drag
.desktop
files from Nautilus to Unity Launcher, it should then appear instantlyYou have to add them to launcher favorites list. To read current list:
To write new list
Not sure if possible to read
dconf
db of 14.04 usingchroot
, If your 14.04 still boot-able, boot it then usedconf read ...
to get the list. Otherwise, write the list manually fromls ~/.local/share/applications
.Have you checked whether the *.desktop files have execution permission? I copied once (with -p option) on 16.04 from /usr/share/applications/ to ~/.local/share/applications/. The files lost execution permission. I guess this is a similar situation.
Current answers provide bits and pieces of the proper approach. In this answer, I would like to provide more coherent overview of what needs to be done to port the
.desktop
files..desktop
files are merely shortcuts for those applications. If the actual application is not installed, it is pointless to copy.desktop
files.As per Ubuntu's security policy, (link https://wiki.ubuntu.com/SecurityTeam/Policies) , the
.desktop
files residing in user's home folder have to have executable bit set in order to run (also discussed on another Ask Ubuntu question here).Quick test confirms that they do not stick to launcher, unless executable bit is set.Without executable bit set, they will not run and Unity will deem such application launcher as untrusted.(Note that if theUse.desktop
is cached in memory, it can still appear on the launcher when you remove executable permission - don't be fooled by that).chmod +x file.desktop
in terminal or right-clicking on application and under Permissions tab check "Allow executing as program" option.Another potential issue is ownership and read permissions. If the file belongs to different user and groups, without read permissions you cannot access
.desktop
file, thus it won't launch and won't still to Unity Launcher. The solution here is to eithersudo chmod +r name.desktop
orchown $USER:$USER name.desktop
.NOTE: I've put strikethrough over parts that turned out to be incorrect. For a very peculiar reason, Unity launcher deviates from the security policy.
Placing
.desktop
files into~/.local/share/applications
(as has been revealed in the comments) doesn't make them appear on Unity launcher. That folder is for storing your own, custom.desktop
files. Adding items to Unity launcher can be done by hand, or via command line withgsetting
ordconf
command. There are alternative approaches, however. Please see this post on multiple ways of adding.desktop
files to the Launcher: https://askubuntu.com/a/829228/295286