FS#54894 - Audacious steals directory default mimetype from Nautilus

Attached to Project: Arch Linux
Opened by Florent Thiery (fthiery) - Friday, 21 July 2017, 07:21 GMT
Last edited by Eli Schwartz (eschwartz) - Friday, 21 July 2017, 14:04 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Whenever installing audacious, the audacious.desktop file specifies that it can handle the inode/directory mimetype; this results in Chromium's open folder of downloaded files to open in audacious instead of Nautilus.

I understand that this can be overriden by running xdg-mime default nautilus.desktop inode/directory but i believe that this should maybe not happen at all (i.e. nautilus should stay the default whenever installing audacious).

$ grep directory /usr/share/applications/*.desktop
/usr/share/applications/audacious.desktop:MimeType=application/ogg;application/x-cue;application/x-ogg;application/xspf+xml;audio/midi;audio/mp3;audio/mp4;audio/mpeg;audio/mpegurl;audio/ogg;audio/prs.sid;audio/x-flac;audio/x-it;audio/x-mod;audio/x-mp3;audio/x-mpeg;audio/x-mpegurl;audio/x-ms-asx;audio/x-ms-wma;audio/x-musepack;audio/x-s3m;audio/x-scpls;audio/x-stm;audio/x-vorbis+ogg;audio/x-wav;audio/x-xm;inode/directory;x-content/audio-cdda;
/usr/share/applications/org.gnome.Nautilus.desktop:Keywords[bg]=папка;файл;навигация;директория;система;диск;устройство;управление;мениджър;folder;manager;explore;disk;filesystem;directory;file;
/usr/share/applications/org.gnome.Nautilus.desktop:MimeType=inode/directory;application/x-gnome-saved-search;

Additional info:
* audacious 3.8.2-1
* nautilus 3.24.2-1

$ xdg-mime query default inode/directory
audacious.desktop
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Friday, 21 July 2017, 14:04 GMT
Reason for closing:  Not a bug
Additional comments about closing:  This is literally how XDG was explicitly designed to operate
Comment by Florent Thiery (fthiery) - Friday, 21 July 2017, 07:22 GMT
Sorry, the correct workaround is:

$ xdg-mime default org.gnome.Nautilus.desktop inode/directory
Comment by Florent Thiery (fthiery) - Friday, 21 July 2017, 07:28 GMT
Just found a related bug: https://bugs.archlinux.org/task/30034

And there is an upstream issue, but rejected too:
http://redmine.audacious-media-player.org/issues/404

Why not sed the .desktop file to remove the MimeType association ? What use cases would it break ?
Comment by Florent Thiery (fthiery) - Friday, 21 July 2017, 07:45 GMT
I understand that since several apps are announcing they support inode/directory, xdg-open will just look them up alphabetically, making nautilus second.

Should nautilus not declare itself as default application upon install ?

https://standards.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.1.html#default
Comment by Florent Thiery (fthiery) - Friday, 21 July 2017, 08:17 GMT
Since XDG standards only provide a manual mecanism for defining priorities as follows, maybe standard file managers such as org.gnome.Nautilus.desktop should register themselves globally (in /etc/xdg/mimeapps.list, /usr/share/applications/mimeapps.list or even /etc/xdg/gnome-mimeapps.list):

[Default Applications]
inode/directory=org.gnome.Nautilus.desktop;

Keeping audacious's directory handling capability is good (for right-click / open with), but not as default.
Comment by Eli Schwartz (eschwartz) - Friday, 21 July 2017, 14:03 GMT
You're misunderstanding the nature of xdg defaults.

Desktop files declare the type of mimetypes they are capable of and allowed to handle. It is considered the user's job to specify their own defaults, and XDG itself will fall back to using whichever desktop file is listed first in mimeinfo.cache -- meanwhile, update-desktop-database, the tool used to create that cache, defines the order as "randomly regenerated from scratch on every invocation", though alphabetically would not really be any better...

XDG itself does not have any sort of preference for file browsers. More generally, this is why the default application for any mimetype can be unexpectedly changed any time you install any desktop file whatsoever. Because frankly, xdg-utils sucks horribly, and most distros just work around the problem by installing their own arbitrary list of application defaults as you suggested.
Which leads to the question "who is responsible for deciding on these arbitrary defaults", and that is a question Arch Linux does not wish to answer, because that would go against the Arch Way (just like having a default file browser installed is *also* against the Arch Way).

In short, how should we know that you prefer Nautilus over audacious (or that you even use Gnome to begin with), and what do we do when someone files a counter-bug because they prefer the manually-installed pcmanfm?

Ironically, Windows has finally managed to (in principle if not in implementation) solve this in a somewhat sane way -- by asking you to select your own preferred default if there isn't one set.

Loading...