You are not logged in.

#176 2016-12-30 02:41:07

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,071
Website

Re: mimeo: open files by mimetype or file name

Sorry for the delayed response.

Without an example, I do not know what you were trying to do (e.g. clear all associations for a MIME-type, all associations for a desktop file or a combination of MIME-types and a desktop file). Looking at the code I found 2 bugs that prevented clearing all associations for a given MIME-type. Those have been fixed and the following now works: "mimeo --clear foo/bar".

The default behavior for clearing a desktop's associations may be counter-intuitive: "mimeo --clear foo.desktop" will remove "foo.desktop" from all MIME-types listed in the desktop file. To completely clear "foo.desktop", use "mimeo --clear 'glob:*' foo.desktop". I have updated the help message to make this clearer. I hesitated to make this behavior the default with this update but the current behavior is coherent with the other operations and keeps the common function simple.

If neither the bug fix nor the usage clarification address your issue, please post a specific example with relevant entries from the mimeapps.list file.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#177 2017-01-27 23:46:38

Alad
Wiki Admin/IRC Op
Registered: 2014-05-04
Posts: 1,463

Re: mimeo: open files by mimetype or file name

I'm having an issue when a document has a subtype of a particular mime type, i.e. image/vnd.djvu+multipage instead of image/vnd.djvu:

[archie@thinkpad ~]$ mimeo --show-all KnuthII.djvu
WARNING: failed to determine command precursor for KnuthII.djvu
WARNING: failed to determine command(s) for KnuthII.djvu
[archie@thinkpad ~]$ mimeo -m KnuthII.djvu
KnuthII.djvu
  image/vnd.djvu+multipage
[archie@thinkpad ~]$ file --mime-type KnuthII.djvu
KnuthII.djvu: image/vnd.djvu

cf. this qpdfview bug where the author decided to match all subtypes:

https://bugs.launchpad.net/qpdfview/+bug/1515018

Not sure if a given desktop file should contain subtypes of a given MIME type, or if the opener should simply count those as part of the main mime type. Also the guy who broke it:

https://mail.gnome.org/archives/commits … 07514.html


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
User:Alad

Offline

#178 2017-01-29 12:13:46

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,071
Website

Re: mimeo: open files by mimetype or file name

I was unaware that MIME-types may consist of the following:

Wikipedia wrote:
top-level type name / subtype name [ ; parameters ]
top-level type name / [ tree. ] subtype name [ +suffix ] [ ; parameters ]

When I have the time, I will add a full MIME-type parser to handle the different components and default to using the main type if no association exists for the subtype. In the meantime, just add associations for each fully qualified type.

I may also add an option to create associations directly from a path argument.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#179 2017-01-29 14:45:45

Alad
Wiki Admin/IRC Op
Registered: 2014-05-04
Posts: 1,463

Re: mimeo: open files by mimetype or file name

Nice, looking forward to the change. big_smile


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
User:Alad

Offline

#180 2017-02-09 23:51:55

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,071
Website

Re: mimeo: open files by mimetype or file name

Both changes have been implemented. If testing for filepath arguments leads to conflicts then I will revert to the previous behavior and add an option to enable this new behavior.

Usage example:

mimeo --prefer /path/to/some/movie.mkv vlc.desktop

Qualified MIME-types (e.g. foo/bar+wuz) will default to unqualified associations (e.g. foo/bar) if no qualified associations are found.

Let me know if you find a bug.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB