[Ilugc] rightclick menu, open file with custom shell script

  • From: narendra.sisodiya@xxxxxxxxx (narendra sisodiya)
  • Date: Fri Mar 19 17:46:27 2010

On Fri, Mar 19, 2010 at 5:41 PM, steve <steve@xxxxxxxxxxxx> wrote:

Hi,


On 03/19/2010 05:16 PM, narendra sisodiya wrote:

I have made some custom shell script to process certain format. for
example
converting .mp3 to .ogg Or processng .ttt files(custom extension zip file)
with shell script. But the problem is I have to go command line and give
filename as argument. is there anyway I can make rightclick on files and
openwith customshell script where filename automatically comes as argument
!

 Sure. If you are using gnome+nautilus, simply right click the file
name->Open with-> Other application-> Use a custom command.

You may choose to directly call your script directly (which *i think* would
result in the script being called in the background) or launch it within a
terminal. Most terminals support launching a command automatically using a
flag (like -e for most xterm variants). So, you can enter something like
this for the custom command:

/usr/bin/gnome-terminal -e your_script_name

The file is passed as an additional argument to this command.

This Trick do not work, I can see terminal but
echo $1 donot print file name



If this is a frequent operation you might OTOH, want to write a nautilus
script so that the option is shown directly in your right-click menu:
http://www.linux.com/archive/feature/114134

cheers,
- steve



-- 
???????????????????????????
?    Narendra Sisodiya ( ???????? ???????? )
?    Society for Knowledge Commons
?    Web : http://narendra.techfandu.org
???????????????????????????

Other related posts: