blob: 6776c94f72341de85f58a22fa06beb9da6c53234 [file] [log] [blame]
swissChilic6b05362022-09-04 18:32:07 -04001#!/bin/bash
2
3shopt -s lastpipe
4
5epub="$(zenity --file-selection)"
6files="$(mktemp -d)"
7unzip "$epub" -d "$files"
8
9# get list of xhtml files to display
10xhtmls="$(ls "$files"/OEBPS/*.xhtml | xargs -l basename)"
11
12choosepart() {
13 echo "$xhtmls" | zenity --list --title "epub parts | $epub" \
14 --text "Choose a part" \
15 --column "Parts" \
16 --width 400 --height 400 \
17 | read part
18
19 if [ "$part" = "" ]; then
20 exit 1
21 fi
22
23 echo part $part
24
25 path="$files/OEBPS/$part"
26 cat "$path" "$(dirname $0)/script.html" > "$path.html"
27
28 firefox "$path.html"
29}
30
31while choosepart; do
32 true
33done
34
35rm -rf "$files"