Custom Actions calling Term

Alexander Toresson alexander.toresson at gmail.com
Fri Dec 8 17:18:05 CET 2006


On 12/8/06, JoeHill <joehill at sympatico.ca> wrote:
> On Fri, 8 Dec 2006 14:59:29 +0100
> Alexander Toresson got an infinite number of monkeys to type out:
>
> > > > I think you forgot to actually give the file you want to burn as an
> > > > argument to cdrecord.
> > >
> > > That's supplied by the %N.
> > >
> >
> > Yes, but it's only passed to the burn_iso script, not to cdrecord.
>
> Ah, okay, so that's why I had to put the full command, rather than the script.
>
> However, another action which I configured worked the opposite way, perhaps
> because of the nature of the commands run in the script? Ex.:
>
> #!/bin/sh
> for i in *.mp3; do lame --decode $i `basename $i .mp3`.wav; done;
>
> ...called 'mp3towav', and called from the context menu like so:
>
> Terminal -x mp3towav %N
>
> In *that* case, the filename is supplied within the script, right?

No, instead, the scripts take all mp3 files in the current directory
(for i in *.mp3) and convert them. It doesn't care about any arguments
you might give it.

$1 would be the first argument passed to the script, $2 the second etc...

For more info, see
http://www.museum.state.il.us/ismdepts/library/linuxguides/abs-guide/
, and specifically the sections about positional parameters and
arglist. Oh, and you should prolly also read up on for loops.

Regards, Alexander Toresson

> Obviously my skills at copy -> paste are far better than my understanding of
> scripting ;-)
>
> Thanks for the clarification! I've got a whole whack of scripts I used with ROX
> Filer, and I'm slowly moving stuff over as I get used to Thunar, that tip will
> help a lot.
>



More information about the Xfce mailing list