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

Eric Wilhelm scratchcomputing at gmail.com
Thu Mar 29 23:49:26 UTC 2007


# from Richard C. Steffens
# on Thursday 29 March 2007 01:46 pm:

>> Try cd $(dirname $0) or so if you want,...

>My scripting is very rusty. I'm not sure what that is supposed to
>accomplish.

$0 is the name of the script.  $() is backticks.  The rest easily found 
in in manpages.

(btw:  $1 is the first argument, you'll want that later.)

>I put it verbatim into the script, but it didn't change 
>anything about the way the script ran -- it still put a reduced sized
>image into ~/640. The code as it now stands:

Where did you put the script?  ~/ ?

I've just noticed that konqueror behaves differently WRT to cwd 
depending on the profile.  E.g. if you click on the browser button, 
you'll get the pwd:=~ behavior and the filemanager icon will give you a 
dirname $0 behavior.  And, executable scripts don't seem to be 
configurable via the standard mechanism.  Bah.  I guess I can get it to 
run perl scripts this way if I make a symlink and use #!/bin/shperl as 
the shebang... I guess the same goes for shlisp and shobol too :-D

Ok, that's enough obscure amusement for one day.

I really do think the "open directory with this program" mechanism would 
be best.  Add an entry for your script using the menu editor 
(right-click on the "K"-menu) then right-click on the directory and go 
to properties, then click the "type" wrench and add an association.

Note, that trick works great for gqview too.

--Eric
-- 
Consumers want choice, consumers want openness.
--Rob Glaser
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------



More information about the PLUG mailing list