45 lines
1.4 KiB
Markdown
45 lines
1.4 KiB
Markdown
|
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
```
|
||
|
xdg-desktop-search [ OPTIONS ] SEARCH ...
|
||
|
```
|
||
|
|
||
|
## Arguments
|
||
|
|
||
|
- `SEARCH`: Search .desktop files with search directives containing this
|
||
|
string. The searched directives are "Name" and "Exec" by default but can be
|
||
|
overridden using the -s option (see below).
|
||
|
|
||
|
## Options
|
||
|
|
||
|
- `-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
|
||
|
when searching in verbose mode, print only this directive (e.g. "Name").
|
||
|
Option can be repeated to print multiple directives.
|
||
|
|
||
|
- `-s STRING`, `--search-directive STRING`: Instead of searching directives
|
||
|
"Name" and "Exec" for strings containing SEARCH, search the given directive
|
||
|
instead (e.g. "Comment"). Option can be repeated to search in multiple directives.
|
||
|
|
||
|
|
||
|
## Return Values
|
||
|
|
||
|
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.
|
||
|
|
||
|
## Example
|
||
|
|
||
|
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
|
||
|
```
|