On Sun, 13 Feb 2005 14:44:02 -0600, Boyd Stephen Smith Jr.
<[EMAIL PROTECTED]> wrote:
> On Sunday 13 February 2005 12:22 pm, Mark Knecht <[EMAIL PROTECTED]>
> wrote:
> > Hi,
> >    This is not a Gentoo thing at all but I don't know where else to
> > ask so I'm coming here. Delete if you're not interested.
> >
> >    I have a suspicion this is some big scripting job. Scripting to any
> > great extent is something I know nothing about. I'm hoping that maybe
> > someone can point me in the right direction. Thanks in advance.
> >
> >    Within Gnome is there a way that I could double click on a file in
> > their browser and then cause the system to start executing a program
> > that asks me questions about what to do? I have some files that are
> > used in a specialized audio program. Each individual file contain
> > multiple instruments. I'd like the script to:
> 
> You'll have to check some gnome-dev documentation, but generally file
> system browsers execute external program by running a simple command line.
> There may be variable in the command-line.  Perhaps %f for the name of the
> file of somesuch.
> 
> > 1) Check the file for available instruments. I know how to do this
> > (sort of) at the command line using something like "gigdump
> > filename.gig | grep Instrument". That almost works well enough for
> > this task but it does produce one extra line I'll need to get rid of.
> 
> If you can get it to execute a bash script, the command-line aruments are
> avilable through $<number> variables.  $0 is how the script was invoked on
> the command line; $1 is the first command-line argument, etc.

Right. Thanks. I'm now passing the filename to the scipt correctly.

> 
> > 2) Pop up a window and tell me about the instrument list
> 
> While bash has no support for this, you may be able to use GTK binding for
> some scipting language Perl/Python to do this.  Your first stop for this
> step is the GTK documentation/tutorial.

Gnome allows me to run my bash script in a terminal so now the
terminal pops up, runs gigdump, greps out the right lines and saves
them to a temp file. I then cat that file to the same terminal and see
the results. Good so far.

> 
> > 3) Ask me which on I want to use

Easy to make it ask the question but so far I cannot find the bash
command to wait for keyboard input. There must be one but I don't see
it in man bash.

> >
> > 4) Ask me a couple more questions that I answer
> 
> Reapeat steps 2-3; If you want to show a GUI and you are already running
> gnome, you'll want to learn/use GTK.

Not into GUI programming today. Just want to see if I can get it to
work. If it does then and it's useful then maybe I'll make a GUI next
Sunday afternoon.
> 
> > 5) Take the set of answers and send it over the network using some
> > command like
> >
> > echo "command 1" | nc localhost 8888
> > echo "command 2" | nc localhost 8888
> 
> Most languages will allow you to execute commands like this with some call.
> This is all bash does; perl has backticks and a few system calls; python
> and C also have system calls.  You may not even need to have the shell do
> the piping, as you generally get/provide some handle to/for the
> stdin/out/err of a subprocess.

Oops - that was beyond my skill level...

> 
> >    I know nothing of doing stuff like this but it would be very
> > helpful. The windows program that uses these files of course has a
> > fancy file browser that allows you to do this with a couple of click &
> > drag operations. The Linux program has nothing so I'm doing this by
> > hand and it's very tedious.
> 
> Well, do get this done you are going to have to learn a bit.  Since you
> need some degree of GUI interaction, you'll probably want to go with perl
> or python for the actual script.  If you have pervious experience with
> shell scripting or perl, go that way.  If not, go the python way, then
> you'll know the language portage is written in and can do some serious
> gentoo hacking. ;)

I'm actually pretty happy if I can pick an instrument out of the list
that the gigdump command gives me and then just tell nc to load it in
LinuxSampler. Jsut happening in an xterm is fine for me.

Thanks,
MArk

--
[email protected] mailing list

Reply via email to