Anomalocaridid / handlr-regex

Fork of handlr with support for regex
MIT License
129 stars 5 forks source link

Opening files with handlr does not respect defaults set in ~/.config/mimeapps.list #36

Closed gnarlsnishi closed 1 year ago

gnarlsnishi commented 1 year ago

Hi, having a strange issue where certain files simply do not open using the correct application as set in my ~/.config/mimeapps.list.

For instance, when opening a .opus file via handlr open, I expect it to use mpv, but instead the file opens in Kid3, an audio tag editing application. Calling handlr list correctly shows that audio/opus and audio/ogg are associated with mpv.desktop. Not sure what I am misunderstanding or doing wrong here. The output of handlr list as well as my mimeapps.list are attached below.

handlrlist.txt

mimeapps.list.txt

Anomalocaridid commented 1 year ago

That certainly is a strange issue. Would you mind running handlr mime on the file and posting the output?

gnarlsnishi commented 1 year ago

Thank you for the nudge in the right direction. It turns out that the mimetype was recognized as audio/x-opus+ogg, which is not a mimetype in the default .desktop entry for mpv. A simple handlr set audio/x-opus+ogg mpv.desktop resolved the issue for me.

Anomalocaridid commented 1 year ago

Glad I could help!

Also, you might want to consider using wildcards like audio/* if you want all mimetypes of a certain category to open in the same program. It would prevent similar problems like this from arising in the future. And you can always override it for individual mimetypes by defining handlers for those mimetypes anyways.

Although I would note that this is almost certainly incompatible with other file openers that use mimeapps.list if that is a concern.