Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
0 votes
in vifm by
edited by

:file command while having a .gpx file selected provides me with the following items:

│a few associations defined in .vifmrc..
│..
│                                                                                                                                             │
│ [present] [New Incognito Window] /usr/bin/google-chrome-stable --incognito %f                                                               │
│ [present] [New Private Window  ] opera --incognito %f                                                                                       │
│ [present] [New Private Window  ] /usr/lib/firefox/firefox --private-window %f       

I am surprised to see only a handful of associated programs from .desktop files, because this is what I get from mimeopen for the same file:

	1) Marble  (marble_gpx)
	2) JOSM  (org.openstreetmap.josm)
	3) notepad  (wine-extension-txt)
	4) XML Editor  (cxassoc-cxoffice-09274308-1263-49f9-9dc8-9aa5429d4a4d:text_xml)
	5) winebrowser.exe  (cxassoc-cxoffice-30699937-611f-4e95-a4c2-b84b1315db49:text_xml)
	6) XML Editor  (cxassoc-cxoffice-c4e90c7e-13fd-4fed-9b8b-ffc7c7b96f8c:text_xml)
	7) Internet Explorer  (wine-extension-xml)
	8) Google Chrome  (google-chrome)
	9) MapTiler Desktop 11.1  (maptiler-desktop)

and after right-clicking the file and selecting "Open With Other Application" in Nautilus I am getting the following list:

GpsPrune
GPX Viewer
GPXSee
Maps
JOSM
QmapShack

Nothing changes if I run vifm with --no-configs.

Arch Linux, x86_64, vifm 0.11.r632.g84ab7ba0e-1, Gnome DE

Thank you, jose

1 Answer

+2 votes
by

Support for parsing desktop entries is quite rudimentary. I added it, but didn't use for long, don't know if it's being used much at all. There are at least two possible reasons:

  1. Files in ~/.local/share/applications aren't parsed.
  2. Mime type isn't determined correctly (Vifm doesn't do the parsing, you can check determined type in Ctrl-G dialog).
by

Thank you. It looks to be case #2. I am seeing Mime Type: text/xml which does not really make sense.

$ mimetype foo.gpx
foo.gpx: application/gpx+xml

This type is also displayed by Nautilus. In vifm sources I can see that GFileInfo (GTK) is attempted first so it kinda makes me wonder if I compiled it correctly. And sure enough there is a --without-gtk in Arch's PKGBUILD. After dropping that switch I now get a proper list of associated programs (almost the same as in Nautilus).

Too bad I don't quite recall why I used that flag but since it's missing in the official package I think I should just blow it away. What do you think?

by

GTK is linked to if GTK is found during configuration, so you probably didn't enable it explicitly.

GTK is used only for mime-types and only because it gave better results for some files at some point, if it doesn't, just turn it off and you won't lose anything.

...