I have installed several Desktop Managers and Window Managers, and changing the file association can become a mess. I need some foolproof method which can allow me to change my user or system file association without having to swim through the GUI, and fine control over what gets associated with what. Is such method available?
How to change my file/url association across all my DM/WM without using the GUI?
file opening;xdg
An easy way to establish file/url associations without messing around with the GUI, and that works on all Freedesktop.org compliant DE/DM/WM is using xdg-query.With xdg-query you can, query what application is associated with a determined MIME/file/URL, change it, and install new ones. Since you want to change your associations the most effective method is:Discover which is the MIME type your file is known of. This can be done with xdg-mime query filetype FILE for files. URL's don't need this. Lets say text/html.Check the application that is associated with:xdg-mime query default text/html    userapp-Iceweasel-41IAMX.desktopNow to change it. You need to know the name of the .desktop file you want to associate the file with (and probably install it if it doesn't exist). The .desktop files are normally found in /usr/share/applications/, so you must make sure the desired .desktop file exist (locate .desktop | grep app may help). I will change mine to emacs:xdg-mime default emacs.desktop text/htmlNow, checking:xdg-mime query default text/html       emacs.desktopNow, I have changed my default application for all files that match the text/html mimetype.This would work with any application that follows Freedesktop.org MIME Applications Associations standard, which is almost all the populars ones.