document installation without git
document how to change format preference
add dummy xdg-open for non-freedesktop systems
Interactively find and open a book from a Calibre library
This project provides the ebk-find
command,
which can be run from the command line
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 -l ~/Books
The runtime dependencies are: perl
, libxml2
, the XML::LibXML
Perl module, fzf
, and xdg-open
.
On Debian etc. they can be installed with:
sudo apt install libxml-libxml-perl fzf
Next, download the source code archive and unpack it:
curl -LSs https://git.sr.ht/~javiljoen/ebookrack-finder/archive/v1.0b1.tar.gz \
| tar xz -C /tmp
Then install the program and manual:
cd /tmp/ebookrack-finder-v1.0b1
make check
sudo make install
To search for and open a book in a given library, run:
ebk-find -l ~/Books
If you only have one library or if you want to set a default,
set the EBOOKRACK_LIBRARY
environment variable (e.g. in ~/.profile
):
export EBOOKRACK_LIBRARY=~/Books
Then the program can be run without options:
ebk-find
All options are described in the reference manual:
man ebk-find
The program is set to prefer opening a PDF to an EPUB to any other format.
To change the order of preference,
edit the @formats
array near the top of the script:
sed -i "/@formats =/s/(.*)/( epub pdf )/" $(which ebk-find)
If your system does not provide the xdg-open
command,
you can customise and install the script provided in contrib/xdg-open
:
vi contrib/xdg-open
install contrib/xdg-open -t ~/.local/bin/
For occasional or once-off usage, a simpler method is to use the -n flag and pass the resulting path to your viewer:
ebk-find -n | xargs -0 ebook-viewer