XDG-TYPES(1)

πŸ“¦ version 1.12, in nixos 26.05, nixpkgs unstable

πŸ’… 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:
    1. the name of a desktop entry file without the .desktop suffix (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 ".".
    2. the name of a desktop entry file with the .desktop suffix (e.g. "gvim.desktop"); the same restrictions as (1), above, apply; or,
    3. 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 ".".
Providing a non-option application identifier argument is mandatory unless the --exec or --appid options 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 that xdg-types is 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 β€” treat APPID as an "XSession" identifier instead of an "Application" identifier.
  • -U, --autostart β€” treat APPID as 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 by xdg-types to determine the user's home directory.
  • XDG_DATA_HOME β€” used by xdg-types to determine the user's XDG data directory. This defaults to $HOME/.local/share. The applications (or xsessions) 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 by xdg-types to determine the system XDG data directories. This defaults to /usr/local/share:/usr/share. The applications (or xsessions) 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 by xdg-types to determine the user's XDG configuration directory. This defaults to $HOME/.config. The autostart subdirectory 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 by xdg-types to determine the system XDG configuration directories. This defaults to /etc/xdg. The autostart subdirectory 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

xdg-which(1), xdg-whereis(1).


πŸ‘‘ 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