Files
org-roam/20230523101440-xdg.org
2025-11-05 09:18:11 +01:00

1.2 KiB

xdg

XDG is a tool that works with mimetypes. With the aid of xdg standard programs can be assigned to certain mimetypes, standard programs can be queried or mimetypes of programs can be displayed

All standard programs are in the file

~.config/mimeapps.list

There also the input of xdg-mime default is stored.

Command

xdg-open <file>

opens the file with the default program specified for the file's mimetype.

xdg-open <file>

opens the file with the default program specified for the file's mimetype.

xdg-mime

query

Performs a query, after:

filetype <file>

xdg-mime query filetype <file> gibt den Mimetype dieser Datei zurück

default <Mimetype>

xdg-mime query filetype <file> returns the mimetype of this file

default

xdg-mime default <program>.desktop <mimetype> sets the named program as the default program for the named mimetype, provided that this program has a .desktop entry in (user generated) /home/<user/.local/share/applications/. The path whe .desktop files are stored by the system; ~/usr/share/applications or usr/local/share/applications~