====== Fix File Associations in xfce4 ====== Had a problem with file associations in [[https://xfce.org/|xfce4]] (my favorite desktop). Basically, [[https://mxlinux.org/|MX Linux]] installs [[http://tarot.freeshell.org/leafpad/|leafpad]] editor by default, but I like [[http://www.geany.org/|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** 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 ===== References ===== * https://superuser.com/questions/720754/xfce-set-up-global-file-associations * http://www.geany.org/ * http://tarot.freeshell.org/leafpad/ * https://xfce.org/ * https://mxlinux.org/