XDG-WHICH(1)
πΈ 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:- the name of a desktop entry file without the
.desktopsuffix (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"."π ββοΈ - 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. 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 thatxdg-whichis 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 byxdg-whichto determine the user's home directory.XDG_DATA_HOMEβ Used byxdg-whichto determine the user's XDG data directory. This defaults to$HOME/.local/share. Theapplications(orxsessions) 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 byxdg-whichto determine the system XDG data directories. This defaults to/usr/local/share:/usr/share. Theapplications(orxsessions) 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 byxdg-whichto determin the user's XDG configuration directory. This defaults to$HOME/.config. Theautostartsub-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 byxdg-whichto determine the system XDG configuration directories. This defaults to/etc/xdg. Theautostartsub-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 π
π 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
- 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