[PLUG] Starting a Shell Script from Konqueror's File Browser

Richard C. Steffens rsteff at comcast.net
Wed Mar 28 22:21:42 UTC 2007


Rogan Creswick wrote:
> On 3/28/07, Richard C. Steffens <rsteff at comcast.net> wrote:
>> Is it possible to start a shell script by clicking on it in some way in
>> Konqueror's file browser? If I hover over the file's icon I see that
>> Konqueror knows that it is a shell script, but when I right click on the
>> icon I don't find an entry for executing said script.
> 
> It doesn't launch when you left-click on it?  (if not, then you may
> need to enable the execute  permissions for your user/group.)

It might be trying to work when I left-click. It may be that there is a
different problem. Here's what I've done so far. The script, named
convert-640, is as follows:

-------------------------------------------------------------------------
#!/bin/bash
for i in *jpg;
do
convert -size 640x640 -resize 640x640 $i 640/`basename $i .jpg`-640.jpg;
done
-------------------------------------------------------------------------

I use it to make smaller copies of the photos I download from my camera.

When I left-click on it "nothing" happens. When I right-click on it and
choose Open With Other, and enter bash in the text bar, "nothing"
happens. When I check "Run in terminal" and "Do not close when command
exits" I get the following error message:

convert: unable to open file `*jpg': No such file or directory.

If I open a terminal window, navigate to the directory containing the
script, and type the command, ./convert-640 it runs correctly, placing a
reduced size copy of all the .jpg files in that directory into a
sub-directory named 640 (I manually created the sub-directory).

This leads me to suspect that there is some tweaking needed somewhere.

I like the idea Terry recommended about putting the .sh extension on
shell scripts I want executed by clicking on them. Once I figure out
what else needs tweaking, I'll apply that modification, too.

-- 
Regards,

Dick Steffens




More information about the PLUG mailing list