slight changes

This commit is contained in:
Henry Hiles 2026-05-22 16:17:10 -04:00
commit 2e1c752bbe
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -10,9 +10,7 @@
text = '' text = ''
input="$1" input="$1"
if [ -f "$input" ] && echo "$input" | grep -qi "\.epub$"; then if echo "$input" | grep -qi "\.acsm$"; then
fullpath="$input"
else
if [ ! -d "$HOME/.config/adept" ]; then if [ ! -d "$HOME/.config/adept" ]; then
adept_activate --anonymous adept_activate --anonymous
fi fi
@ -23,17 +21,14 @@
| sed "s/^Created //") | sed "s/^Created //")
adept_remove "$fullpath" adept_remove "$fullpath"
else
fullpath="$input"
fi fi
name=$(basename "$fullpath" | rev | cut -d. -f2- | rev) name=$(basename "$fullpath" | rev | cut -d. -f2- | rev)
ext=$(echo "$fullpath" | rev | cut -d. -f1 | rev) ext=$(echo "$fullpath" | rev | cut -d. -f1 | rev | tr '[:upper:]' '[:lower:]')
if [ "$ext" = "epub" ]; then
ebook-convert "$fullpath" "/run/media/quadradical/Kindle/documents/$name.mobi" ebook-convert "$fullpath" "/run/media/quadradical/Kindle/documents/$name.mobi"
rm "$fullpath"
else
mv "$fullpath" "/run/media/quadradical/Kindle/documents/$name.pdf"
fi
''; '';
}) })
]; ];