From 2fdba2c2e8d02f403df4841fb794a7bff4731fda Mon Sep 17 00:00:00 2001 From: Steven Saus Date: Thu, 2 May 2024 01:16:42 -0400 Subject: [PATCH] Here we go! --- books_search.sh | 15 ++++++++++++--- books_search_rewrite_plan.sh | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 books_search_rewrite_plan.sh diff --git a/books_search.sh b/books_search.sh index eeac415..333f7e4 100755 --- a/books_search.sh +++ b/books_search.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash - +# TO SEARCH IN EPUB +# zipgrep -ihw -C2 STRING FILE | unhtml +# +# Can multi-tag from fzf! Search multiple books for a string! +# ############################################################################## # # books_search.sh @@ -111,7 +115,12 @@ main() { #use ROFI, not zenity SelectedBook=$(calibredb list -f title,authors | awk '/^[1-9]/' | rofi -i -dmenu -p "Which Book?" -theme DarkBlue |awk '{print $1}') fi - + # TODO - handle multiple selections here + # TODO - strip out ROFI; make cli only + # TODO - redo handling opening of books + # TODO - searching text of ebooks + echo "${SelectedBook}" + exit NumFormats=$(calibredb list --search id:"${SelectedBook}" -f formats --for-machine 2>/dev/null | grep -c -e \"\/) echo "$NumFormats" if [ $NumFormats -gt 1 ];then @@ -142,7 +151,7 @@ main() { book=$( echo "$SelectedBook" | awk -F '|' '{print $4}' | xargs) type=$( echo "$SelectedBook" | awk -F '|' '{print $1}' | xargs) fi - + if [ -n "$book" ]; then if [ "${GUIOutput}" == "true" ];then CliOnly="false" diff --git a/books_search_rewrite_plan.sh b/books_search_rewrite_plan.sh new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/books_search_rewrite_plan.sh @@ -0,0 +1 @@ +