Add My Command to Service Menu

OK.
Let me try it with one %f

P.S.
I noticed “/home/limo/.local/bin/” has what appears to me to be python progs! So I assume if my script is made Python and placed in this folder it should work.
I will try and report back.

You know what, I am glad that at this age I am back to university, Endeavour University!

Doesn’t matter. It should work for any script, Bash, Python, JavaScript or whatever… and also for binary executables.

You probably have a mistake somewhere.

Nop! it didn’t work. Maybe because the command ocrmypdf has $1 input file and another $1 output file (to over write the no text old pdf with the new one with same name)

UPDATE:
For now the only one working till now is OCR.desktop (above)
I will keep trying, reading and studying.
I am back to Endeavour University!

honka_memes-128px-13

1 Like

Are you suggesting I try learn Java not Python?

image

1 Like

:thinking: :thinking: :thinking:
What then?! :rofl: :thinking:

JavaScript and Java are two completely different languages that have nothing in common, except the first four letters of the name.

Nobody is suggesting you learn either.

I merely mentioned JavaScript as an example of a scripting language. Python is just as bad, in my opinion.

As an “old” good days programmer (DOS days, BASIC, dBase III+) Python seemed to me to be the silver bullet!
Excuse my ignorance.

I don’t really want to get into a discussion about which language is good. It’s too much soy this early in the morning, and besides, it’s a mostly a matter of personal opinion.

BTW...

C is the best programming language.

Of course not… every language has its purpose, pros and cons!

Sure, it is the programming language of serious programmers… but … oh no thanks! Not for me! I tried it before! It didn’t taste well for me though it was so powerful.

It’s absolutely delicious!

float inverse_sqrt(float x) {
    float xhalf = 0.5f * x;
    int i = *(int*)&x;
    i = 0x5f375a86 - (i >> 1);
    x = *(float*)&i;
    x = x * (1.5f - xhalf * x * x);
    return x;
}

explanation

Don’t worry!
It is my nature to keep learning everyday. For living is mainly about learning.
The day that I don’t learn something new I don’t count as a day I lived!
( I am an economist mainly, my study, my career, my hobby! Though I graduated 1985 I still read and study what’s new in the science… daily, same about computers and IT… etc as spare time hobby… )

2 Likes

What the heck is this! I never saw something like that before!

2 Likes

honka_animated-128px-29

Just to update you.
Our helpful friend at KDE Forums suggested

 Exec=konsole --noclose -e 

to show progress of file conversion
So I made a copy of OCR.desktop having:

Exec=konsole --noclose -e /home/limo/.local/bin/ocrmypdf -l ara+eng %F %F

And it worked… though it didn’t close after finished.

UPDATE:
I removed the noclose

Exec=konsole -e /home/limo/.local/bin/ocrmypdf -l ara+eng %F %F

It showed me the progress then closed the terminal after finished!

This is much more than what I was trying to do!
:tada: :partying_face: :beers: :partying_face: :tada:

Oooops… I couldn’t even read that! :rofl:

Stop teasing me :imp:, pleeeeeeeease :rofl:

This is not good.

There should be only one %F or %f.

But it won’t work in your case, since you have the same file as input or output. Have you figured out what’s wrong with your script?

Your script takes only one argument, and that’s fine, because you have "$1" "$1" in it.

I tried already and it didn’t work! I don;t know why!

I think because the command ocrmypdf requires a source file and a target file to work.

Perhaps click on the explanation link in my post above :wink: