Fix File Associations in xfce4
Had a problem with file associations in xfce4 (my favorite desktop). Basically, MX Linux installs leafpad editor by default, but I like Geany (a programming editor). Nothing wrong with Leafpad; it is small, lightweight, and does what a basic editor should do. But, I edit code and like syntax highlighting (and search/replace on regex).
So, I wanted to move all the associations over. These are done via mime types.
To fix this, I installed Geany, then created the file /usr/share/applications/mimeapps.list. This allows you to set up default apps and override what is listed.
I don't know if it is an xfce4 thing, or for all desktops, but /usr/share/applications contains a bunch of .desktop files which appear to set up each application for use by the window manager, and Geany is no exception. There is a geany.desktop file, which contains a list of all mime types geany supposedly supports (it does NOT contain everything I use it for, however). So, I just grabbed those and created the new file.
This will destroy your non-default mime associations. Do not do it if you already have the file
- geanydefault.sh
apt-get -y install geany echo '[Default Applications]' /usr/share/applications/mimeapps.list grep MimeType geany.desktop | cut -d'=' -f2 | sed 's/;/=geany.desktop\n/g' >> /usr/share/applications/mimeapps.list