Show in ... menu item

Answered

Running IDEA on Centos 7 and the Show In 'Explorer' menu item is showing as 'Show in Disk Usage Analyzer'? any idea why or how to correct it? think the shell is Nautilus, should it read Show in Shell? that's what it does, it doesn't open disk usage analyzer at all?

7 comments
Comment actions Permalink


hmm, if I turn debug on for that query I get this:

$ XDG_UTILS_DEBUG_LEVEL=3 xdg-mime query default "inode/directory"

Checking /home/navplus/.local/share/flatpak/exports/share/applications/defaults.list
Checking /home/navplus/.local/share/flatpak/exports/share/applications/defaults.list
Checking /var/lib/flatpak/exports/share/applications/defaults.list
Checking /var/lib/flatpak/exports/share/applications/defaults.list
Checking /usr/local/share/applications/defaults.list
Checking /usr/local/share/applications/defaults.list
Checking /usr/share/applications/defaults.list
Checking /usr/share/applications/defaults.list
Checking /usr/share/applications/org.gnome.baobab.desktop
Select /usr/share/applications/org.gnome.baobab.desktop [ -1 => 0 ]
Checking /usr/share/applications/org.gnome.Nautilus.desktop
org.gnome.baobab.desktop


boabab is apparently the name for Disk Usage Analyzer.

Whats odd is all these defaults.list files it queries. None of these exist on centos 7, with rhel 7 the name of the mime files changed from defaults.list to mimeapps.list. But from the above it appears nobody told xdg about this change?
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/desktop_migration_and_administration_guide/file_formats

Other thing that's odd is right at the end it finds both org.gnome.boabab and org.gnome.Nautilus, but the former (incorrect) seems to win the lookup. why? I'm not sure how either of these matches are made, as I said from the debug output, none of the mime lookups should have returned anything due to the missing files. I'm left none-the-wiser.

xdg query also returns same result on another centos 7 server we created last week, but has not been installed as yet. So not just my machine. 

0
Comment actions Permalink

Ok I think I might know whats going on, because all the mime type db files are 'missing' (so far as xdg is concerned) it delegates to looking through all the .desktop files and both

/usr/share/applications/org.gnome.baobab.desktop,
/usr/share/applications/org.gnome.Nautilus.desktop

Have 
inode/directory as their mime type, appears the first desktop file baobab wins? 

Don't think the mimetypes are incorrect, directories are the default associations for both.

0
Comment actions Permalink

ugh open source desktops, seems issue(s) have been known about since 2012, gnome passed the buck  - likely to never be fixed?

https://bugzilla.gnome.org/show_bug.cgi?id=687598

https://bugs.archlinux.org/task/31861

0
Comment actions Permalink

Does any of `mimeapps.list` files in your system contain the "[Default Applications]" section with "inode/directory=..." line in it?

Just for the record, on my Ubuntu/GNOME the query logs this:

Checking /home/sher/.config/mimeapps.list
Checking /home/sher/.local/share/applications/defaults.list and /home/sher/.local/share/applications/mimeinfo.cache
Checking /home/sher/.local/share/applications/defaults.list and /home/sher/.local/share/applications/mimeinfo.cache
Checking /usr/local/share/applications/defaults.list and /usr/local/share/applications/mimeinfo.cache
Checking /usr/local/share/applications/defaults.list and /usr/local/share/applications/mimeinfo.cache
Checking /usr/share/applications/defaults.list and /usr/share/applications/mimeinfo.cache
org.gnome.Nautilus.desktop

Of these, I happen to have `~/.config/mimeapps.list` and `/usr/share/applications/defaults.list`, with the latter associating directories with Nautilus.

The latest spec definitely uses `mimeapps.list` and has zero mentions of `defaults.list`; GNOME reads both. If I got it right, the problem could be in a distro shipping outdated/misconfigured XDG utils, or in utils themselves not following their own spec.

BTW, how did you install the IDE? These Flatpak dirs in the query look suspicious.

0
Comment actions Permalink

Yes the default mimeapp.list in /usr/share/applications/ does assign inode/directory to org.gnome.Nautilus. Also baobab isn't mentioned at all in any of the mimeapp.list files. But there are no defaults.list files at all in any directory on CentoOS 7 (7.6). I'm assuming that's why it xdg-mime starts querying every .desktop file and how it finds baobab and Nautilus.

What I've done is edit the org.gnome.baobab.desktop file and remove the inode/directory MimeType entry (just commenting it out didn't work). So now the same query only returns Nautilus desktop file. IntelliJ IDEA now shows 'Show in Files' so I guess it didn't really need the shell name. Is a second or two delay when I right click to when the menu appears. Wasn't sure if it was the extended .desktop queries. Servers new to me, not sure what's normal in terms of performance.

Think the only thing I loose is being able to right click folders and open in disk usage analyser. But I can still launch it and drill down to the folders I'm interested in. It's better than having it appear incorrectly as the default shell (not just in idea). Seemed a safer 'fix' than symbolically linking mimeapps.list to defaults.list in every xdg query folder.

flatpak I know nothing about, didn't build the server our devops team do that. It was pretty sparse when I got got my hand on it, no frills. The other so far unused  server I commissioned last week also shows same flatpak queries. Must either be part of the distro or our devops kickstarter build.

 

0
Comment actions Permalink

Sorry for the late reply.

With file associations, there are two rather different queries: (1) give me all programs able to open this file, and (2) give me the default program for opening this file. The first one is served from `mimeinfo.cache` files which are ultimately built from *.desktop files and should contain both Baobab and Nautilus. The second query is served from these `mimeapps.list`/`defaults.list` files and should tell which program is the preferred one - i.e. these files should list only Nautilus. The first query is used by Nautilus for the context (right-click) menu; the second one - by the IDE via `xdg-mime query default ...`.

To me, the problem seems to be that on that system the defaults are stored in `mimeapps.list`, but XDG utils are searching `defaults.list` - so symlinking the latter to the former and restoring the association in `baobab.desktop` should make the system to behave as desired.

0

Please sign in to leave a comment.