Tuesday, March 29, 2016

How to Fix: Firefox + Wine + "Open With" List

I forget why I even have wine in the first place, but I do.
(Wine, in this context, is a piece of software that lets me run Windows programs on my Linux system.)

Every once in a while, Firefox and Thunderbird would come across a file or attachment and prompt me for what to do with it.  Infuriatingly, the default choice was sometimes wine or some terrible wine version of explorer, or something.  I scoured Firefox's about:config and anything else I could think of, but there was no mention of wine associated with file types.  Web searches were useless too.

Finally, I found this:

https://wiki.winehq.org/FAQ#How_do_I_clean_the_Open_With_List.3F

Relevant snippet:
rm -f ~/.local/share/mime/packages/x-wine*
rm -f ~/.local/share/applications/wine-extension*
rm -f ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*
rm -f ~/.local/share/mime/application/x-wine-extension*

That is what I needed.  ~/.local/share had some crap in it which many desktop applications, Mozilla's included, found and used to figure out handlers for different file types.  I can't imagine that setting anything to do with wine for such things could ever be useful for any reason ever, but if you use windows programs on purpose, you may wish to pick through those files a little bit more carefully than I did.

After nuking those, extensionless text files no longer try to open in some bastardized version of notepad.exe, oddly-formatted image files no longer try to launch some weird windows tool, and I no longer get angry at my computer for trying to run terrible programs for no reason.

My hope is that if I post this, I'll save at least one poor sap some time in their search for the same answer.