Usage
After installing the package (see the installation guide), the ebk-find command can be run to interactively select a book based on its title, authors, and/or tags. The path to the selected book is passed to xdg-open for opening with the default viewer.
$ ebk-find
Specifying the library path
To search a library that is not in the default location, use the -l/--library flag:
$ ebk-find -l ~/books
This can also be set permanently: see the configuration instructions.
Choosing a specific file format
By default, ebk-find opens the EPUB file for the selected book, if there is one; otherwise, it opens the PDF, if there is one; otherwise, it opens the first file it can find. The order of preferred formats can be changed with the -f/--format-preference flag:
$ ebk-find -f 'txt,azw3,epub'
Using a different selection program
By default, the interactive selection is delegated to the fzf command. A different command can be used by setting the -s/--selection-command option:
$ ebk-find -s 'sk --exact'
This can also be set permanently: see the configuration instructions.
Non-graphical or Windows/macOS systems
If your system does not provide the xdg-open command, use the -n/--dont-open option to just print the path to the file, and pass the result to the correct program:
$ ebk-find -n | xargs -0 pdftotext | less
$ acrobat.exe "$(ebk-find -n -f pdf)"
Note the use of the -0 flag for xargs: the path is zero-terminated (ends in a null byte) to allow it to be interpreted correctly by the shell, since the file name will typically contain spaces.
Alternatively, you could provide your own xdg-open
script, executable and somewhere on your PATH. (See this blog
post for an example.) ebk-find can then be run
without the -n flag.