XDG-WHICH(1)

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

🌸 XDG-WHICH(1) β€” the xdg-which manual, bestie edition 🌸

okay so welcome to the xdg-which man page, it's a User Commands situation and honestly she's iconic πŸ’…


✨ NAME ✨

xdg-which β€” show the full path of XDG desktop entries πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

xdg-which [options] [--] APPID [...]

πŸ’– DESCRIPTION πŸ’–

So xdg-which takes one or more arguments. For each one of them, it prints to standard output the full path of the desktop entry that would have been launched when that argument had been supplied to xdg-launch(1). Like, it's doing the exact same detective work, no cap πŸ”

The way it does this: it searches 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 same algorithms as xdg-launch(1). Same brain, same vibes 🧠✨


πŸŽ€ ARGUMENTS πŸŽ€

The program accepts the following arguments:

  • APPID β€” Specifies the application identifier of an XDG desktop application to locate. The application identifier, APPID, can be one of the following:
    1. the name of a desktop entry file without the .desktop suffix (e.g. "gvim"); the name may contain a "/" if it is specified relative to a user or system application directory, in which 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. so like, don't forget it bestie 😭

πŸ’… OPTIONS πŸ’…

The options that are detailed below are recognized by xdg-which. Also, heads up: xdg-which uses getopt_long_only(3), so unambiguous abbreviations of long options and long options with a single dash are also supported. cute, right? 🫢

🌈 COMMAND OPTIONS 🌈

The default is to match the APPID and provide output. When any of the following options are specified, the command mode changes:

  • -l, --list β€” Output list of effective lookup paths that xdg-which is using. like a little map of where she's looking πŸ—ΊοΈ
  • -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. legal era πŸ“œβœ¨

⭐ 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. she's thorough πŸ’―
  • -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. ~ girlie 🀍
  • -m, --mime-types β€” Also output an indented list of supported mime types for the desktop entry, one per line.

πŸ“ EXAMPLES πŸ“

Following are some examples of invocation and output:

 $> xdg-which wmbattery
 /usr/share/xde/applications/wmbattery.desktop

 $> xdg-which -U -a --show-tilde wmbattery
 ~/.config/autostart/wmbattery.desktop
 /etc/xdg/xde/autostart/wmbattery.desktop
 /etc/xdg/xde/autostart/wmbattery.desktop

(and yes, that last path shows up twice in the original output β€” not a typo on my end, that's literally what it prints πŸ™ˆ slay)


🌸 ENVIRONMENT 🌸

The following environment variables are examined by xdg-which:

  • HOME β€” Used by xdg-which to determine the user's home directory.
  • XDG_DATA_HOME β€” Used by xdg-which to determine the user's XDG data directory. This defaults to $HOME/.local/share. The applications (or xsessions) sub-directory 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-which to determine the system XDG data directories. This defaults to /usr/local/share:/usr/share. The applications (or xsessions) sub-directory 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-which to determin the user's XDG configuration directory. This defaults to $HOME/.config. The autostart sub-directory 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-which to determine the system XDG configuration directories. This defaults to /etc/xdg. The autostart sub-directory under these directories are searched in order to locate desktop entry files. See the XDG Desktop Entry file specification for more information.

πŸ’€ BUGS πŸ’€

xdg-which has no known bugs. periodt. πŸ’… Please report bugs to the source code repository at <https://github.com/bbidulock/xdg-launch/issues>.


πŸ‘‘ SEE ALSO πŸ‘‘

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


πŸ’œ AUTHOR πŸ’œ

Brian Bidulock <mailto:bidulock@openss7.org>


okay that's the whole page, go be iconic with your paths bestie πŸŒˆπŸ¦‹ and hey, credit where it's due: this is xdg-launch 1.12, dated 2022-01-28. mwah πŸ’‹

πŸ“¦ where this page comes from