💾 Archived View for darknesscode.xyz › notes › epr-epub-reader.gmi captured on 2023-09-08 at 16:07:27. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-05)

-=-=-=-=-=-=-

epr an ePub Reader

epr is a CLI epub reader written in Python 3.6, is very simple and functional. The only problem with epr is that only support epub files, but that is ok for my use.

Download epr script

There are different way to install epr, you can install it via pip3, PyPi. If you are in Arch Linux is in the AUR epr-git.

I like to install/download just the epr.py scrip it works well, the dependency is python 3.6

curl https://raw.githubusercontent.com/wustho/epr/master/epr.py

After you download the script, make it executable

sudo chmod +x epr.py

Then you can rename it to epr

mv epr.py epr

How to use epr

Let's say that you rename it to epr and is in your home directory, open a terminal

./epr ~/path/to/directory/books/epub

You read a ebook (epub) and you close it, next time you run just ./epr without arguments it will remember the last book and chapter

I like to do almost everything in the terminal, but this time i don't want to type the full path were my books are. Here is were **dmenu** is awesome for this, I create this silly script to work with dmenu

#!/bin/bash

lines=10
terminal="urxvt"
folders="$HOME/Documents/my-reading/books/"
reader="$HOME/Documents/my-reading/epr"

find -L $folders | sed 's/ /\\ /g' | sort -f | dmenu -i -b -l $lines -p " Open Book To Read : " | xargs -I {} $terminal -e $reader "{}"

This is the directory structure i used for this

* books (directory for all the books)

* spr (i rename it)

* dmenu-reading.sh (dmenu to list all books and open them with spr)

This dmenu/script is working fine for me and works in **Arch Linux** and **Void Linux**

Key binding

| Description     | Command                        |
| --------------- | ------------------------------ |
| Help            | ?                              |
| Quit            | : q                            |
| Scroll down     | : DOWN j                       |
| Scroll up       | : UP   k                       |
| Half screen up  | : C-u                          |
| Half screen dn  | " C-d                          |
| Page down       | : PGDN  RIGHT  SPC             |
| Page up         | : PGUP  LEFT                   |
| Next chapter    | : n                            |
| Prev chapter    | : p                            |
| Beginning of ch | : HOME  g                      |
| End of ch       | : END   G                      |
| Open image      | : o                            |
| Search          | : /                            |
| Next Occurence  | : n                            |
| Prev Occurence  | : N                            |
| Toggle width    | : =                            |
| Set width       | : [count]=                     |
| Shrink          | : -                            |
| Enlarge         | : +                            |
| ToC             | : TAB t                        |
| Metadata        | : m                            |
| Mark pos to n   | : b[n]                         |
| Jump to pos n   | : `[n]                         |
| Switch colorsch | : [default=0, dark=1, light=2] |

Check the repo for epr.py in Github

----------

Home

Linux

Notes

MicroLog

----------

© DarknessCode