3 ms·
I love calibre but I find that a lot of the time I want to open a recently read book or one I know by name. Cold starting calibre, finding the book, opening the
by michaelmrose 7y ago
I love calibre but I find that a lot of the time I want to open a recently read book or one I know by name. Cold starting calibre, finding the book, opening the book, minimizing or closing calibre is a 4 step process that takes 15-30 seconds. Further it takes up about 250MB in memory to avoid that 4-8 second wait for it to start. By default without specifying a field it finds results in text describing the book which is almost never what I want as well.
Calibre has a cli interface calibredb. One could use that but it would be vastly more cumbersome than using the gui. It isn't at all designed to be used interactively unless you like typing switches like --for-machine and mixing in a lot of jq in preparation for opening a book.
What I really wanted to do was type a quick command with a search query just like I would type at the calibre search box have it pop open a list that I could narrow by typing hit enter and open a book. One step and 1 - 10 seconds to open a book instead of 15-30 without a process taking up ram all the time for no reason.
https://github.com/michaelmrose/rdr https://github.com/michaelmrose/rdr
Written in clojure and compiled to a portable executable with graal next to no requirements outside of rofi or dmenu and currently being tied to linux. Could presumably be be compiled for mac if I had one. It uses 19MB of ram for the and starts about instantly.
-q [query] => pass query with the same syntax as calibredb or calibregui accepts
-l => open the last book read
-r => filter the most recent 30 distinct books opened via rdr via rofi or dmenu
query string => If a string is passed in without -q -h -l -r specified it is treated as a query
-o [file] => open with default reader and record in recent reads if part of a calibre library
-S [options] => save options passed to disk
Options
-p [list] => list of formats in order of preference eg pdf,epub,mobi
-k [number] => number of recent reads to keep
--port PORT
--server URL
--user USER
--password PASSWORD"
The recommended usage is to pass the desired defaults with -S then omit them on future invocations. Example:
rdr -S -L /path/to/library -p pdf,epub,mobi -k 10 -p 8090 --user me --password hunter2
then
rdr -q query string here
I currently have a keybinding tied directly to rdr -l and rdr -r and use it all the time. 1 button to go back to the most recently read book is nice.
I'd also love any feedback anyone wanted to provide about the code.