xdg directories
Rename the folders in your home dir.
alternatives
xdg tools are famously challenging to configure. It might be easier to use an
alternative program instead of xdg-open which has a nicer configuration.
https://github.com/green7ea/sesame
xdg-mime set or query default programs
determine a file's mimetype
xdg-mime query filetype file.png
determine the default application for a mimetype
xdg-mime query default image/png
change the default application for a mimetype
xdg-mime default feh.desktop image/png
set default terminal for gio / gsettings
Firefox and possibly other programs will use your xdg settings via a library
called gio which is a gnome thing. Basically, if you want firefox to open a
terminal with nnn or ranger or any other tui file manager do the following:
- Install
GConf - Figure out where your terminal is installed
which alacrittyand what flag it uses for launching a program inside it-eforalacritty. - Make sure
nnn.desktopis set as your default forinode/desktop.xdg-mime query default inode/directoryI set mine in~/.config/mimeapps.list - Set your default terminal with gsettings. I don't really know if this worked
because I STILL needed to manually edit the
nnn.desktopfile...gsettings set org.gnome.desktop.default-applications.terminal exec /bin/alacrittygsettings set org.gnome.desktop.default-applications.terminal exec-arg "-e"