SYNOPSYS

A quick reminder of the basics.

Environment

1
XDG_CONFIG_HOME=$HOME/.config

xdg-user-

$XDG_CONFIG_HOME/user-dirs.dirs

1
2
3
4
5
# to configure a directoru
xdg-user-dirs-update --set DESKTOP $HOME/Desktop

# to query a directory
xdg-user-dir DESKTOP

xdg-mime

$XDG_CONFIG_HOME/mimeapps.list

1
2
3
4
5
6
7
8
# to configure the default application
xdg-mime default org.gnome.Evince.desktop "application/pdf"

# to query the default application for a given mimtype
xdg-mime query default "application/pdf"

# to query the mimetype of a file
xdg-mime query filetype file.pdf

xdg-open

1
2
# consider that is launch the application pointed by
xdg-mime query default "$(xdg-mime query filetype FILE_PATH)"