KDE: sending files to a script from the browser

Joel Hammer joel
Mon May 17 11:56:16 PDT 2004


I am writing a bash script to put comments in images. The script is called
from the KDE browser with the open with option.

This script involves calling vi to edit the comment.

This script works fine with one file. However, when I try to send  several
files, KDE behaves in a way I didn't expect.

Instead of sending all the files on one command line, or sending  the
files sequentially, it seems to send them all at once, starting multiple
instances of the script.

It's  not just my bash script. xv does the same thing.

This works fine for one file. If two files are sent, KDE  starts two
instances of this script at the same time. This is undesirable.

Is there some way to make KDE behave differently? 
Is there an easy way to keep the second instance of the script from
starting until the first instance is done? 
Or, delaying opening of the file with vi?

I tried to use a loop in the script to watch for other instances of
vi and delay until vi was terminated, which would be ideal, but, the
scripts all seem to be starting simultaneously.

I suspose one solution is to have a script that just dumps these file
names into a file, and then run a second script which does the editing
of each file sequentially.

Any suggestions welcome.

Joel



More information about the Linux-users mailing list