kota's memex

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:

  1. Install GConf
  2. Figure out where your terminal is installed which alacritty and what flag it uses for launching a program inside it -e for alacritty.
  3. Make sure nnn.desktop is set as your default for inode/desktop. xdg-mime query default inode/directory I set mine in ~/.config/mimeapps.list
  4. Set your default terminal with gsettings. I don't really know if this worked because I STILL needed to manually edit the nnn.desktop file... gsettings set org.gnome.desktop.default-applications.terminal exec /bin/alacritty gsettings set org.gnome.desktop.default-applications.terminal exec-arg "-e"