Thanks, the script provided in that link in Thunar custom actions looks nice:
pdf-to-djvu
Code: Select all
#!/bin/bash
OLDIFS="$IFS"
IFS=$'\n'
for PDF in "$@"; do
FILE="${PDF%.*}"
echo "Which pages ? e.g. type: 1-6, for all pages, press ENTER"
read pages
if [ -n "$pages" ]; then
pdf2djvu -o "$FILE".djvu "$PDF" --pages=$pages
else
pdf2djvu -o "$FILE".djvu "$PDF"
fi
done
IFS="$OLDIFS"
read -s -n 1 -p "Press any key to close . . ."
I would probaly add a double check, to have it apply only on pdf files.
As currently this script would try to take any file to convert,
so the script will not have only rely onto Thunar-custom action file-rules.
(e.g. just in case you start it from the command line or make the custom action rules wrongly. )
Just change the line add the beginnin of the for loop like
and add a line before this line
to check and do nothing on that file of not a .pdf file:
Code: Select all
[ "${PDF%.pdf}" = "${PDF}" ] && continue