XDG-TYPES(1)
π NAME
xdg-types β shows you the content types that a desktop application is serving, bestie β¨
Okay so real talk, the man page name is XDG-TYPES(1) and this is a User Commands situation, and we're about to get into it π«Ά
πΈ SYNOPSIS
xdg-types [options] [--] APPID [...]
π¦ DESCRIPTION
So xdg-types takes one or more arguments (yes, plural, she's flexible π
). For each and every argument you hand her, she prints to standard output the full path of the desktop entry that would have been launched if that argument had been given to xdg-launch(1). Iconic behaviour honestly.
How does she do it? She goes searching for a desktop entry in the appropriate sub-directories of the "XDG_CONFIG_DIRS", "XDG_CONFIG_HOME", "XDG_DATA_DIRS" and "XDG_DATA_HOME" environment variables, using the exact same algorithms as xdg-launch(1). Same energy, same rules, no cap π₯
π ARGUMENTS
The program accepts the following arguments:
APPIDβ specifies the application identifier of an XDG desktop application to locate. And like, the application identifier,APPID, can be any one of these three (3) situations:- the name of a desktop entry file without the
.desktopsuffix (e.g."gvim"); the name may contain a"/"if it's specified relative to a user or system application directory, and in that case it must not start with a"/"or".". - the name of a desktop entry file with the
.desktopsuffix (e.g."gvim.desktop"); the same restrictions as (1), above, apply; or, - the full path (absolute or relative) and filename of a desktop entry file (e.g.
/usr/share/applications/gvim.desktop); the full path must contain at least one"/"and start with either a"/"or a".".
- the name of a desktop entry file without the
Providing a non-option application identifier argument is mandatory unless the--execor--appidoptions are specified. Like, she needs something to work with, okay? π
β¨ OPTIONS β¨
The options detailed below are recognized by xdg-types. Heads up: xdg-types uses getopt_long_only(3), so unambiguous abbreviations of long options and long options with a single dash are also supported. Shortcuts slay π
π COMMAND OPTIONS
The default is to match the APPID and provide output. But when any of the following options are specified, the command mode changes (main character mode switch, lowkey):
-l,--listβ outputs the list of effective lookup paths thatxdg-typesis using.-h,--helpβ prints usage information to standard output and exits.-V,--versionβ prints detailed version information and exits.-C,--copyingβ prints detailed copying permissions and exits.
β GENERAL OPTIONS
The following general options are recognized:
-X,--xsessionβ treatAPPIDas an"XSession"identifier instead of an"Application"identifier.-U,--autostartβ treatAPPIDas an"Autostart"identifier instead of an"Application"identifier.-a,--allβ print all matching desktop entries, not just the first. Greedy in the best way π-o,--skip-dotβ skip directories in"XDG_CONFIG_DIRS"and"XDG_DATA_DIRS"that start with a dot.-t,--skip-tildeβ skip directories in"XDG_CONFIG_DIRS"and"XDG_DATA_DIRS"that start with a tilde, and entries that reside in"XDG_CONFIG_HOME"or"XDG_DATA_HOME".-O,--show-dotβ if a directory starts with a dot and a matching desktop entry was found for that path, then print"./appid.desktop"rather than the full path.-T,--show-tildeβ output a tilde when a directory matches the"HOME"directory.-m,--mime-typesβ also output an indented list of supported mime types for the desktop entry, one per line. This is the good stuff π
π₯ EXAMPLES
$> xdg-types firefox
/usr/share/xde/applications/firefox.desktop
text/html
text/xml
application/xhtml+xml
application/xml
application/rss+xml
application/rdf+xml
application/vnd.mozilla.xul+xml
text/mml
x-scheme-handler/http
x-scheme-handler/https
x-scheme-handler/ftp
Look at all those mime types. She ate and left zero crumbs π
π ENVIRONMENT
The following environment variables are examined by xdg-types:
HOMEβ used byxdg-typesto determine the user's home directory.XDG_DATA_HOMEβ used byxdg-typesto determine the user's XDG data directory. This defaults to$HOME/.local/share. Theapplications(orxsessions) subdirectory under this directory is the first searched to locate desktop entry files. See the XDG Desktop Entry file specification for more information.XDG_DATA_DIRSβ used byxdg-typesto determine the system XDG data directories. This defaults to/usr/local/share:/usr/share. Theapplications(orxsessions) subdirectory under these directories are searched in order to locate desktop entry files. See the XDG Desktop Entry file specification for more information.XDG_CONFIG_HOMEβ used byxdg-typesto determine the user's XDG configuration directory. This defaults to$HOME/.config. Theautostartsubdirectory under this directory is the first searched to locate desktop entry files. See the XDG Desktop Entry file specification for more information.XDG_CONFIG_DIRSβ used byxdg-typesto determine the system XDG configuration directories. This defaults to/etc/xdg. Theautostartsubdirectory under these directories are searched in order to locate desktop entry files. See the XDG Desktop Entry file specification for more information.
π BUGS
xdg-types has no known bugs. Not a single one. Flawless, allegedly π
Please report bugs to the source code repository at <https://github.com/bbidulock/xdg-launch/issues>. Be nice about it π«Ά
π§ SEE ALSO
π AUTHOR
Brian Bidulock <mailto:bidulock@openss7.org>
That's the whole thing bestie, go forth and locate those desktop entries π
signing off with love β version xdg-launch 1.12, dated 2022-01-28, from the XDG-TYPES(1) girlies π
π¦ where this page comes from
- nixos 26.05: xdg-launch 1.12
- nixpkgs unstable: xdg-launch 1.12
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms