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 = ''
input="$1"
if [ -f "$input" ] && echo "$input" | grep -qi "\.epub$"; then
fullpath="$input"
else
if echo "$input" | grep -qi "\.acsm$"; then
if [ ! -d "$HOME/.config/adept" ]; then
adept_activate --anonymous
fi
@ -23,17 +21,14 @@
| sed "s/^Created //")
adept_remove "$fullpath"
else
fullpath="$input"
fi
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"
rm "$fullpath"
else
mv "$fullpath" "/run/media/quadradical/Kindle/documents/$name.pdf"
fi
ebook-convert "$fullpath" "/run/media/quadradical/Kindle/documents/$name.mobi"
'';
})
];