38

A few facts: I use Wine. Wine ships its own version of Notepad. For some files, this copy of Notepad has somehow become associated. There is no possibility of me ever actually wanting to open anything in Notepad.

I figure I could try and find out what Notepad is associated with and re-associate that with my editor of choice but that seems deeply tedious. Is there any global way to stop Notepad existing as a method for opening files?

Oli
  • 293,335

2 Answers2

47
  • wine-notepad creates a local mime association for text/plain and some other types in the file ~/.local/share/applications/mimeinfo.cache; this effectively allows it as an alternative to anything gedit (or your default GUI editor) would otherwise open
  • To disable, open ~/.local/share/applications/mimeinfo.cache in a text editor and delete the lines with the MIME types text/plain and text/html
  • Also move/delete wine-extension-txt.desktop and wine-extension-htm.desktop from ~/.local/share/applications/
  • Most text or text-like files should default back to your GUI editor
ish
  • 139,926
6

Removing the associations from ~/.local/share/* will work temporarily, until you install something new and winemenubuilder runs again.

Instead, you may also wish to prevent wine from creating file associations in the first place.

K3---rnc
  • 1,235
  • For those who would like to keep some menu items and even some file associations created by WINE, it might be a good idea to write a simple script to get rid of some reasonably unnecessary file associations like Notepad only. – Sadi Jan 05 '14 at 12:24
  • 1
    which ones, particularly, would you say are reasonable? opening *.jpgs in MSIE6? :D – K3---rnc Jan 05 '14 at 13:37
  • All such stupid MS stuff for sure:-D – Sadi Jan 05 '14 at 14:17
  • Actually it would be useful to be able to disable opening text and image files with MS stuff, but still keep the possibility to launch *.doc and friends with MSOffice installed under Wine... – Maciek D. Jun 30 '15 at 06:00
  • @MaciekD. You can customize your file-opening preferences arbitrarily. See ~/.local/share/applications/mimeinfo.cache and wine subdirectory in that directory. You can also create totally custom .desktop launcher files to suit yourself as well as have any of the popular desktop environments (Gnome, KDE, Xfce, LXQT) take care of the preferred association for you. No? – K3---rnc Jun 30 '15 at 09:13
  • @K3---rnc I know I can, but the problem is I have to do it manually. Actually what I did was installing MSOffice, turning of wine recreating associations and then removed all unwanted ones. I could have turned the assiociations off in the first place, but then I would have to associate .doc, .docx, etc. manually. It is possible, but by all means quite tedious. I am lazy and I like if the software allows to do the Right Things automatically ;) – Maciek D. Jun 30 '15 at 18:17
  • @K3---rnc IMO the only extensions it should have are exe and msi. – kagronick May 19 '17 at 14:02
  • @kagronick You definitely should let let Wine developers know. – K3---rnc May 19 '17 at 20:12