Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

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



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

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

$ xdg-mime query default inode/directory
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:

And there is an upstream issue, but rejected too:

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 ?
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]

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.