From ab9ab40b8ee707fbc2bbd2c394f2a6ca91afe8ad Mon Sep 17 00:00:00 2001 From: Slatian Date: Sat, 7 Oct 2023 20:32:52 +0200 Subject: Document quirks with xdg-mime for query file and query default --- scripts/desc/xdg-mime.xml | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'scripts/desc') diff --git a/scripts/desc/xdg-mime.xml b/scripts/desc/xdg-mime.xml index 7ac0b76..54b0922 100644 --- a/scripts/desc/xdg-mime.xml +++ b/scripts/desc/xdg-mime.xml @@ -1,8 +1,8 @@ - @@ -83,26 +83,40 @@ and adding descriptions for new file types Commands - query + query file - Returns information related to file types. + Returns the file type of FILE in the form of a MIME type. - The query option is for use inside a desktop session only. - It is not recommended to use xdg-mime query as root. + Please note that FILE names starting with a - will be rejected, this can be mitigated: + + Pass absolute paths, i.e. by using realpath as a preprocessor. + Prefix known relative filepaths with a ./. For example using sed -E 's|^[^/]|./\0|' as a preprocessor. + - The following queries are supported: - - query filetype FILE: - Returns the file type of FILE in the form of a MIME type. + The query file option is for use inside a desktop session only. + It is not recommended to use xdg-mime query file as root. - query default mimetype: + + + + + query default + + Returns the default application that the desktop environment uses for opening files of type mimetype. The default application is identified by its *.desktop file. + + The value returned by this command may or may not match the application launched by xdg-open as xdg-open hands over to desktop specific openers most of the time which may implement their own logic. + + + The query default option is for use inside a desktop session only. + It is not recommended to use xdg-mime query default as root. + -- cgit v1.2.3