Show bash while .sh script called from x.desktop service menu

I made a ocr.sh script, and created ocr.desktop to run it from service menu.

#!/bin/bash
echo $1
echo "starting OCR"
ocrmypdf --clean --output-type pdf -l ara+eng "$1" newfile.pdf

touch -r "$1" newfile.pdf
mv newfile.pdf "$1"
echo "done"

I am trying to get “feed back” from the script while it is running as I get if I did the command from bash. I am getting nothing.

I added as you see to echo commands, but I get nothing.
What can be done to be able to follow what is going on while executing the command inside the .sh script? I don’t mind launching bash but should close closed automatically when done.

Can we see the .desktop file?

Make sure you have Terminal=true in the .desktop if you want the command to run in a visible terminal.

1 Like

Done!
Working perfect as expected!
You are always there for the rescue usual!

1 Like
[Desktop Entry]
Terminal=true
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=application/pdf;
Actions=Ocr
Icon=applications-pdf

[Desktop Action Ocr]
Name=Ocr
Icon=application-pdf
Exec="/home/limo/Software/MyScripts/ocr.sh" %F

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.