I have this line inside a Dolphin service-menu file that contains many other commands for PDF processing:
Exec=bash -c 'f="%u"; ocrmypdf "$f" "${f%.pdf}_ocr.pdf";'
It has the advantage of giving an output file of the form MY_PDF_ocr.pdf
, thus keeping the name of the input file. But I would prefer to have the command running in terminal (konsole
) so that I see the process.
For that, I can use the line:
Exec=konsole --noclose -e ocrmypdf "%u" ocr_en.pdf
but without the output keeping the name of the input.
A line like
Exec=konsole --noclose -e ocrmypdf "%u" "${%u}_ocr.pdf"
does nothing.
How to adjust the ocrmypdf
so that the command is run in konsole and the output includes the name of the input?