2024-11-03 19:08:55 +01:00
|
|
|
# XDG-DESKTOP-SEARCH(1) - Search for .desktop files
|
2024-11-03 16:49:29 +01:00
|
|
|
|
2024-11-03 19:08:55 +01:00
|
|
|
## SYNOPSIS
|
2024-11-03 16:49:29 +01:00
|
|
|
|
|
|
|
```
|
|
|
|
xdg-desktop-search [ OPTIONS ] SEARCH ...
|
|
|
|
```
|
|
|
|
|
2024-11-03 19:08:55 +01:00
|
|
|
## DESCRIPTION
|
|
|
|
|
|
|
|
xdg-desktop-search locates files with names that end in `.desktop` in
|
|
|
|
sub-directories of name "applications" of a collection of directories
|
|
|
|
refered to as "XDG data directories". It the searches the lines of such
|
|
|
|
desktop files for "directives", meaning key-value-assignments such as
|
|
|
|
`Exec=/some/program` where the assigned value matches one of the search
|
|
|
|
string given as commandline arguments SEARCH.
|
|
|
|
|
|
|
|
xdg-desktop-search prints a list of files that match the given search
|
|
|
|
criteria, it optionally prints selected directives from the file.
|
|
|
|
|
|
|
|
xdg-desktop-search returns successfully if the search rendered one or
|
|
|
|
more results and unsuccessfully otherwise.
|
|
|
|
|
|
|
|
The path of XDG directories searched can be modified by altering the
|
|
|
|
environment variable `XDG_DATA_DIRS`.
|
|
|
|
|
|
|
|
## ARGUMENTS
|
2024-11-03 16:49:29 +01:00
|
|
|
|
|
|
|
- `SEARCH`: Search .desktop files with search directives containing this
|
|
|
|
string. The searched directives are "Name" and "Exec" by default but can be
|
2024-11-03 19:08:55 +01:00
|
|
|
overridden using the `-s` option (see below).
|
2024-11-03 16:49:29 +01:00
|
|
|
|
2024-11-03 19:08:55 +01:00
|
|
|
## OPTIONS
|
2024-11-03 16:49:29 +01:00
|
|
|
|
|
|
|
- `-h`, `--help`: Print this message and exit.
|
|
|
|
|
|
|
|
- `-v`, `--verbose`: Print directives in found .desktop files.
|
|
|
|
|
|
|
|
- `-d STRING`, `--show-directive STRING`: Instead of printing all directives
|
2024-11-03 19:08:55 +01:00
|
|
|
when searching in verbose mode, print only the directive given by `STRING`
|
|
|
|
(e.g. "Name"). Option can be repeated to print multiple directives.
|
2024-11-03 16:49:29 +01:00
|
|
|
|
|
|
|
- `-s STRING`, `--search-directive STRING`: Instead of searching directives
|
2024-11-03 19:08:55 +01:00
|
|
|
"Name" and "Exec" for strings containing `SEARCH`, search the given directive
|
2024-11-03 16:49:29 +01:00
|
|
|
instead (e.g. "Comment"). Option can be repeated to search in multiple directives.
|
|
|
|
|
2024-11-03 19:08:55 +01:00
|
|
|
## RETURN VALUES
|
2024-11-03 16:49:29 +01:00
|
|
|
|
|
|
|
The command returns 0 if .desktop files were found that match the specified
|
|
|
|
criteria, 1 on usage error and 2 if no matching .desktop files were found.
|
|
|
|
|
2024-11-03 19:08:55 +01:00
|
|
|
## EXAMPLE
|
2024-11-03 16:49:29 +01:00
|
|
|
|
|
|
|
Search for the string "firefox" in all .desktop files found in the path
|
|
|
|
specified by `XDG_DATA_DIRS`. To match, the string "firefox" must be contained
|
|
|
|
in either the "Exec" or the "Comment" directive. List the matching files, also
|
|
|
|
show the "Exec" and "TryExec" directives in each found file.
|
|
|
|
|
|
|
|
```shell
|
|
|
|
xdg-desktop-search -s Exec -s Comment -v -d Exec -d TryExec firefox
|
|
|
|
```
|
2024-11-03 19:08:55 +01:00
|
|
|
|
|
|
|
## AUTHOR AND COPYRIGHT
|
|
|
|
|
|
|
|
Copyright © 2024 Tilman Kranz <t.kranz@tk-sls.de>
|
|
|
|
|
|
|
|
## LICENSE
|
|
|
|
|
|
|
|
xdg-desktop-search is distributed under the terms and conditions of the MIT
|
|
|
|
license <https://opensource.org/license/mit>.
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
|
|
this software and associated documentation files (the “Software”), to deal in
|
|
|
|
the Software without restriction, including without limitation the rights to
|
|
|
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
|
|
of the Software, and to permit persons to whom the Software is furnished to do
|
|
|
|
so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
|
|
copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
SOFTWARE.
|