Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MimeType= entry in desktop files is not respected in open with context menu. #2277

Open
fallaciousreasoning opened this issue Dec 20, 2019 · 2 comments
Labels

Comments

@fallaciousreasoning
Copy link

 * Nemo version (nemo --version): nemo 3.8.5
 * Distribution - gLinux
 * 64 bit

Issue
MimeType associations from desktop files don't show up in the right-click context menu in Nemo, only associations from mimeapps.list.

Steps to reproduce
Create a new .desktop file called test-entry.desktop, with the following contents:

[Desktop Entry]
Version=1.0
Name=Test Entry
Icon=/usr/share/icons/hicolor/256x256/apps/gedit.png
Exec=/usr/bin/gedit %F
Terminal=false
MimeType=text/plain
Type=Application

Note: According to the the spec page the MimeType entry should indicate that the application can handle files with the text/plain mime type.

Note: I'm using gedit as an example. Also, the desktop entry doesn't seem to work unless the icon is valid.

Install the desktop entry by running the following command:

xdg-desktop-menu install test-entry.desktop

Check that the entry was installed correctly by searching for "Test Entry" in the menu/launcher. Opening it should launch gedit.

Create a new text file foo.txt. Right click on this file in nemo.

nemo-no-option

Expected behaviour
Test Entry should be a recommended option for opening foo.txt. The below screenshot shows what happens in the Dolphin file manager (which is correct, as I understand it).
dolphin-option

Other information
Nemo does seem to know that test-entry.desktop can handle files (I believe it looks for the %F argument to Exec), just not the types it can actually handle (i.e. it shows up in the Other Applications section of the open with menu, not the Recommended Applications section). It could just be that I'm misunderstanding how this is meant to work.

To test that the handler is registered with properly, I listed the output of mimeopen for foo.txt
mimeopen output and Test Entry is listed as an option.

Nemo seem to use the [Added Associations] in mimeapps.list to determine what applications to show in the open with menu. This is somewhat inconvenient, as there is no easy way (that I could find) to edit this via command line tools (you can change the default application with xdg-mime default text/plain test-entry.desktop but not add/remove associations).

Nautilus has the same behavior as Nemo, but I wasn't sure whether to include that as a data point for expected behavior, as I believe this is a fork of that project?

@fallaciousreasoning
Copy link
Author

I filed a similar bug against Nautilus here

@icarter09 icarter09 added the BUG label Dec 11, 2020
@WhyNotHugo
Copy link

As a temporary workaround, you can run the following to update mimeapps.list:

update-desktop-database ~/.local/share/applications

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants