Ubuntu – How to eliminate wine application options from Thunar’s context menu?

context menufile associationthunarwinexfce

I have Xfce and in Thunar file association are changing randomly, to wine applications
like jpeg and png to Internet Explorer and mp3 to Windows Media Player. I change it back to gpicview and Totem and after a while, when I click on the file it starts up wine again (which takes forever to load, and IE doesn't even work, and gives an error when it loads).

How can I make my file association changes permanent, and stop them changing to wine software?

Best Answer

  • The very useful wine FAQ contains details on how to clean the open with menu. I can confirm that it works safely on Xfce and will on any other desktop environment, as the locations that wine installs the items to are standard locations for those types of files as delineated at freedesktop.org.

    The commands below are from the Wine FAQ and do safely remove all open-with entries from the context menu, but they do not remove any wine entries from the applications menu, which I think is just what you want. If you need to see what they will remove, place echo before the rm command, and it will list the changes. You should run each command individually and not copy and paste the whole block, in case you make a mistake.

    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* 

    It should also be said that when you install a wine program, further new entries will be created, so these commands will need to be run again. The only way to permanently stop the creation of these items is to disable winemenubuilder, but that also affects application menu items and not just the open with menu, so you might not want to do that. See the wine FAQ for more details on that.

    If you want to run the commands above after installing a new wine program, it would be best to put them in a script, make it executable (chmod u+x) and bind it to a shortcut key. Then you can run the script regularly and keep the open with menu clear of wine entries at all times.