Results 1 to 3 of 3

Thread: How can I remove all instances of a program from file associations?

  1. #1
    Join Date
    Oct 2008
    Location
    Mojave desert
    Posts
    314

    Default How can I remove all instances of a program from file associations?

    In KDE, I can easily search for a file association and set the default and alternate programs used to open it. What I want to do is search for a program, and set the file types. Okay, what I really want to do is just wipe out all instances of certain programs.

    Install any program with wine, and you get notepad added to the list for every flavor of text, plus Internet Explorer for everything web-related, one instance per program installed with wine! And aegisub, a subtitle editor for videos, also shows for everything having to do with text. Deleting them one-by-one from hundreds of file types is tedious, but is there a config file to edit? Then I could search-and-replace. As nearly as I can determine, the config files in home/.local/share/menu only show changes to the default, and I can't find where the default is stored in the root system. /usr/share/applications/mimeapps.list is empty, and editing mimeapps.cache in the same directory makes no difference for the next new user profile.

    Thanks,

    GEF

  2. #2
    Join Date
    Oct 2008
    Location
    Mojave desert
    Posts
    314

    Default Re: How can I remove all instances of a program from file associations?

    Is it bad etiquette to answer my own question?

    So that empty file I mentioned turns out to be the right one: /home/<username>/.local/share/applications/mimeapps.list.

    If it doesn't exist, create it, and add the lines

    [Removed Associations]
    text/plain=aegisub.desktop;wine-extension-txt.desktop;

    Or whatever mimetype, or whatever app by the name of its desktop file.

    I found a mimeinfo.cache file, and got the format for the desktop files. I just searched for wine, and copied every line where the mimetype didn't include wine, but the desktop files did. For instance, the line "application/x-wine-extension-msp=wine-extension-msp.desktop;" should not go in removed applications because you'll still want wine top open windows programs.

    It should go without saying, but I want to be clear: If other apps showed up in the list for a mimetype, I deleted them from the line that I added to [Removed Associations] group. For instance, I found this line in mimeapps.cache, "application/xml=wine-extension-xml.desktop;google-chrome.desktop;" but what I copied was just "application/xml=wine-extension-xml.desktop;" because I still want chrome to open xml files.

    GEF

  3. #3
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    1,006

    Default Re: How can I remove all instances of a program from file associations?

    Quote Originally Posted by gfagan View Post
    In KDE, I can easily search for a file association and set the default and alternate programs used to open it. What I want to do is search for a program, and set the file types. Okay, what I really want to do is just wipe out all instances of certain programs.

    Install any program with wine, and you get notepad added to the list for every flavor of text, plus Internet Explorer for everything web-related, one instance per program installed with wine! And aegisub, a subtitle editor for videos, also shows for everything having to do with text. Deleting them one-by-one from hundreds of file types is tedious, but is there a config file to edit? Then I could search-and-replace. As nearly as I can determine, the config files in home/.local/share/menu only show changes to the default, and I can't find where the default is stored in the root system. /usr/share/applications/mimeapps.list is empty, and editing mimeapps.cache in the same directory makes no difference for the next new user profile.

    Thanks,

    GEF
    You may search for:

    Code:
    karl@erlangen:~> find -name '*.list'
    ./.local/share/applications/mimeapps.list
    ./.config/mimeapps.list
    ./.config/mate-menu/applications.list
    karl@erlangen:~>
    Code:
    erlangen:~ # find / -xdev -name '*.list'|xargs grep -l Application
    /var/cache/gio-2.0/lxde-mimeapps.list
    /var/cache/gio-2.0/gnome-mimeapps.list
    /var/cache/gio-2.0/xfce-mimeapps.list
    /usr/share/applications/gnome-mimeapps.list
    /usr/share/applications/defaults.list
    /usr/share/gdm/greeter/applications/mimeapps.list
    /usr/share/xfce/applications/defaults.list
    erlangen:~ #
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), openSUSE Tumbleweed, KDE Plasma 5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •