Skip to content

Commit 42187d1

Browse files
committed
search helpers: Change the group name, follow my own rules for mimetype
list termination, improve readme.
1 parent d6e8444 commit 42187d1

9 files changed

+21
-21
lines changed

libnemo-private/nemo-search-engine-advanced.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#define DEBUG_FLAG NEMO_DEBUG_SEARCH
3333
#include "nemo-debug.h"
3434

35-
#define SEARCH_HELPER_GROUP "Nemo Search Cat Helper"
35+
#define SEARCH_HELPER_GROUP "Nemo Search Helper"
3636

3737
#define FILE_SEARCH_ONLY_BATCH_SIZE 500
3838
#define CONTENT_SEARCH_BATCH_SIZE 1

search-helpers/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,32 @@ Nemo's file and content search utilizes a plugin-type system to allow content se
44

55
The only requirements for a helper is the ability to extract text from a given file type and print it to stdout. A definition file provides details necessary to use the helper.
66

7-
##### Example definition file:
7+
##### Example definition file (note: text/plain support is built-in to nemo, this is only to illustrate):
88

99
```
10-
[Nemo Search Cat Helper]
11-
TryExec=pdftotext
12-
Exec=pdftotext %s -
13-
MimeType=application/pdf;
14-
Priority=200
10+
[Nemo Search Helper]
11+
TryExec=cat
12+
Exec=cat %s
13+
MimeType=text/plain;
14+
Priority=100
1515
1616
```
17-
The `Nemo Search Cat Helper` group name is mandatory.
17+
The `Nemo Search Helper` group name is mandatory.
1818

1919
- The filename must end in `.nemo_search_helper`.
2020
- `TryExec` should be set to the name of the executable (without any arguments). When the helpers are loaded, Nemo will
2121
check that the program a) exists and b) is executable. If these checks fail, the helper will be skipped. If only a
2222
program name is provided, it must exist in the user's path. This can also be an absolute path.
2323
- `Exec` should provide the full command line necessary to extract the text from the file. The `%s` argument will be replaced by
2424
the file name being processed during content search. Note, uris are not supported, only paths (local files).
25-
- `MimeType`is a semicolon (`;`)-separated list of mimetypes that this search helper should be used with. It must be
25+
- `MimeType`is a semicolon (`;`)-separated list of mimetypes that this search helper should be used with. It should be
2626
semicolon-terminated (even if there's only a single item).
2727
- `Priority` is a value used to break a tie when multiple helpers support the same mimetype. The higher value wins. In the
28-
event of a tie, the last helper processed is used (the order is currently undefined). If the `Priority` entry is missing,
28+
event of a tie, the last helper processed is used (the order of files processed is undefined). If the `Priority` entry is missing,
2929
the value is assumed to be 100.
3030
- The `TryExec`, `Exec` and `MimeType` keys are mandatory.
3131

32-
These definition files can be placed in `<datadir>/nemo/search-helpers` where `<datadir>` can be some directory in XDG_DATA_DIRS or under the user's data directory (`~/.local/share/namo/search-helpers`). The user directory is processed last, and takes precedence over the system dirs.
32+
These definition files can be placed in `<datadir>/nemo/search-helpers` where `<datadir>` can be some directory in XDG_DATA_DIRS or under the user's data directory (`~/.local/share/namo/search-helpers`). The user directory is *always* processed last.
3333

3434
##### Debugging:
3535
If something doesn't seem to be working, you can run nemo with debugging enabled:

search-helpers/mso.nemo_search_helper

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[Nemo Search Cat Helper]
1+
[Nemo Search Helper]
22
TryExec=nemo-mso-to-txt
33
Exec=nemo-mso-to-txt %s
4-
MimeType=application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.openxmlformats-officedocument.presentationml.presentation
4+
MimeType=application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.openxmlformats-officedocument.presentationml.presentation;
55
priority=100
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[Nemo Search Cat Helper]
1+
[Nemo Search Helper]
22
TryExec=exif
33
Exec=exif -m %s
4-
MimeType=image/jpeg;image/png;image/gif;image/bmp;image/tiff
4+
MimeType=image/jpeg;image/png;image/gif;image/bmp;image/tiff;
55
Priority=100
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[Nemo Search Cat Helper]
1+
[Nemo Search Helper]
22
TryExec=id3
33
Exec=id3 -l %s
4-
MimeType=audio/mpeg
4+
MimeType=audio/mpeg;
55
Priority=100

search-helpers/third-party/libreoffice.nemo_search_helper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[Nemo Search Cat Helper]
1+
[Nemo Search Helper]
22
TryExec=odt2txt
33
Exec=odt2txt %s
44
MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.presentation;application/vnd.oasis.opendocument.graphics;

search-helpers/third-party/pdf2txt.nemo_search_helper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[Nemo Search Cat Helper]
1+
[Nemo Search Helper]
22
TryExec=pdf2txt
33
Exec=pdf2txt %s
44
MimeType=application/pdf;

search-helpers/third-party/pdftotext.nemo_search_helper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[Nemo Search Cat Helper]
1+
[Nemo Search Helper]
22
TryExec=pdftotext
33
Exec=pdftotext %s -
44
MimeType=application/pdf;

search-helpers/third-party/ps2ascii.nemo_search_helper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[Nemo Search Cat Helper]
1+
[Nemo Search Helper]
22
TryExec=ps2ascii
33
Exec=ps2ascii %s
44
MimeType=application/ps;

0 commit comments

Comments
 (0)