You are not logged in.

#1 2020-06-25 15:35:45

Matpiz
Member
Registered: 2017-02-13
Posts: 6

[SOLVED] Gnome does not display .desktop applications entries

Hi, for some time now I've noticed that my desktop environment (gnome) does not seem to show my .desktop entries.

Recently, I installed a very nice image viewer called "emulsion" (https://github.com/ArturKovacs/emulsion) via rust cargo tool. It gets installed in ~/.cargo/bin which is in my path. I'd really like to choose it as my default viewer via "righ click/Open With Other Application" but it does not appear there. So I thought that if I'd make a desktop entry for it, it would show up in the list of applications to choose from. Problem is I'm not successful in doing it.

Here is the content of the file ~/.local/share/applications/emulsion.desktop

[Desktop Entry]
Type=Application
Name=Emulsion
Comment=A fast and minimalistic image viewer
GenericName=Image viewer
Exec=emulsion
# Icon=application
Terminal=false
Categories=Graphics;

I've tried following both gnome help page https://developer.gnome.org/integration … es.html.en and arch instructions https://wiki.archlinux.org/index.php/desktop_entries but nothing seems to be working. desktop-file-validate is happy about it but whatever I do, it does not show up in gnome applications.

Any idea of what I can do?

Gnome shell version: 3.36.3 (on X, not wayland)
Kernel: 5.4.48-1-lts

Last edited by Matpiz (2020-06-28 07:20:24)

Offline

#2 2020-06-25 17:46:36

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,091

Re: [SOLVED] Gnome does not display .desktop applications entries

Is this emulsion example just an example? Do you have other program with .dektop files not showing up in gnome?

If emulsion is the only program having this problem:

I am not sure if comments are allowed in desktop files, and if so, if # is the correct comment character.

There is an AUR package for emulsion that comes with
a desktop file

Does this one work? And why don't you use that AUR package?

Last edited by Stefan Husmann (2020-06-25 17:58:54)

Offline

#3 2020-06-25 17:53:09

svito
Member
From: Ukraine
Registered: 2018-12-25
Posts: 16

Re: [SOLVED] Gnome does not display .desktop applications entries

You did not specify a Path directory in .desktop file from where your executable is located, also make sure emulsion binary has executable bit set for your user.

Offline

#4 2020-06-25 18:57:41

Matpiz
Member
Registered: 2017-02-13
Posts: 6

Re: [SOLVED] Gnome does not display .desktop applications entries

Stefan Husmann wrote:

Is this emulsion example just an example? Do you have other program with .dektop files not showing up in gnome?

I have other .desktop files there (in ~/.local/share/applications) but none are showing up. But I took emulsion as an example because it was more annoying to me than previous ones. I think the comments are ok since the example in the arch guide is full of them. But I've removed it just to be sure and it's the same.

Stefan Husmann wrote:

There is an AUR package for emulsion that comes with
a desktop file
Does this one work? And why don't you use that AUR package?

Thanks for the info! I tend to prefer always using the package manager closest to the language used for the tool, and to install in user space so using cargo really fit me well. In addition, it's not the only program I've installed with cargo, there are many other (command line) tools installed this way on my machine. Also, the AUR package forces me to install Rust through pacman and I really does not want that since it's managed with rustup. Thanks for the link to the desktop file there. I've tried it without luck. Also tried both .desktop files in /usr/share/applications/ instead of in ~/.local.

svito wrote:

You did not specify a Path directory in .desktop file from where your executable is located, also make sure emulsion binary has executable bit set for your user.

Yep it's executable. I thought Path just corresponded the current working dir according to arch guide page. Nevertheless I've tried to add Path=/home/matthieu/.cargo/bin
to the file. It didn't change the situation.

I can't help but think that the issue is not specific to this desktop file but due to something else. Have you already encountered this situation?

Last edited by Matpiz (2020-06-25 19:03:28)

Offline

#5 2020-06-25 19:10:25

Matpiz
Member
Registered: 2017-02-13
Posts: 6

Re: [SOLVED] Gnome does not display .desktop applications entries

In case the issue is related to gnome changes, does someone know where I can ask such question? I had not found any gnome discussion forum yet but just stumbled upon https://discourse.gnome.org/. Maybe I can ask there.

Offline

#6 2020-06-25 19:43:43

svito
Member
From: Ukraine
Registered: 2018-12-25
Posts: 16

Re: [SOLVED] Gnome does not display .desktop applications entries

If you are using GNOME Wayland and launching the file by typing it will not appear until you relogin. Changes are applied in application overview instantly though, so if your file is valid it will appear there right away.

Offline

#7 2020-06-28 07:15:22

Matpiz
Member
Registered: 2017-02-13
Posts: 6

Re: [SOLVED] Gnome does not display .desktop applications entries

Solution found here: https://discourse.gnome.org/t/applicati … mpizenberg

The issue was due to `~/.cargo/bin` not being in the path for non interactive shells. So @svito you had the good intuition but setting the `Path` line was not how to fix it (it's just the current working dir). But now I feel a bit stupid for not having tried to use `Exec=/home/matthieu/.cargo/bin/emulsion %F` instead of `emulsion %F`.

Thanks a lot for the help svito and Stefan!

Offline

Board footer

Powered by FluxBB