Usage

After installing the program (see the installation guide), the ebk-select command can be run to interactively select a book based on its title, authors, publisher, and/or tags. The path to the selected book is passed to xdg-open for opening with the default viewer.

To select and open a book in the default library, just run:

ebk-select

Specifying the library path

To search a library that is not in the default location, use the -l flag:

ebk-select -l ~/books/

This can also be set permanently: see the configuration instructions.

Choosing a specific file format

By default, ebk-select opens the EPUB file for the selected book, if there is one. Otherwise, it opens the first file it can find. To preferentially select a different file type, use the -f flag:

ebk-select -f pdf

Using a different selection program

By default, the interactive selection is delegated to the fzy command. To use a different command, e.g. fzf, use the -s flag:

ebk-select -s 'fzf --exact'

This can also be set permanently: see the configuration instructions.

Note: If you wish to use fzf as selection command, please ensure that you have fzf ≥ 0.53.0 (released in June 2024). Older versions do not work (issue #11).

Non-graphical or Windows/macOS systems

If your system does not provide the xdg-open command, use the -n flag to just print the path to the file, and pass the result to the correct program:

ebk-select -n | xargs -0 pdftotext | less
preview "$(ebk-select -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-select can then be run without the -n flag.