| Author |
Message |
penguinman007
Guest
|
Posted: Tue 19 Jul 2005, 22:23 Post subject:
How do I run a shell command when icon clicked? (Solved?) |
|
I have a script that I want to run in a shell.
If I open RXVT and type the name of the script, the script runs.
I want this to happen when I click an icon.
When I click this icon, I want rxvt to open and my script to run.
Currently I have an executable text file sitting on my desktop.
The contents of this file are thus:
rxvt myscript
If I click on this icon, rxvt does not run, and my script does not run.
But my intention is that when I click on this icon rxvt should run, and my script should run.
Any suggestions ?
Thanks
penguinman007
|
|
Back to top
|
|
 |
Flash
Official Dog Handler

Joined: 04 May 2005 Posts: 9911 Location: Arizona USA
|
Posted: Tue 19 Jul 2005, 23:33 Post subject:
|
|
Just to be sure, you have read this post, right?
|
|
Back to top
|
|
 |
prnguinman007
Guest
|
Posted: Wed 20 Jul 2005, 01:04 Post subject:
|
|
I read that post:
#! /bin/sh
at the start of my script file does not pop up a shell.
I need a shell to pop up and display the output of the program I run within that shell.
This is the process I am trying to implement:
1. User clicks an icon.
2. Shell opens automatically and my script runs magically within this shell.
This is very basic.
I just don't know how to do it.
I can run XRVT with the following script:
XRVT
But I cant run XRVT and then run programs from within that XRVT shell because
XRVT
myscript
does not work
XRVT <myscript
also does not work
XRVT <<myscript
also does not work
myscript >XRVT
does not work
etc
thanks in advance for all the help.
Puppy is awesome
Penguinman007
|
|
Back to top
|
|
 |
puppian

Joined: 18 Jul 2005 Posts: 538 Location: PuppyLand
|
Posted: Wed 20 Jul 2005, 05:43 Post subject:
|
|
See if this work:
#! /bin/sh
rxvt -e myscript
Copy the above to a text editor,
save it as /root/my-application/bin/myapp,
type "chmod 755 /root/my-application/bin/myapp" in rxvt to make it executable.
I tried this with "rxvt -e mp3blaster" and it works. However I don't how to add arguments to mp3blaster. E.g. "rxvt -e mp3blaster -a mylist.lst" (I want to tell mp3blaster to load my playlist and play automatically on startup) doesn't work. Any idea?
BTW, you can always type '--help' after a command to get more help, e.g.
rxvt--help
|
|
Back to top
|
|
 |
Guest
Guest
|
Posted: Wed 20 Jul 2005, 18:24 Post subject:
|
|
Hey thanks for that ,
It works !
For your problem, you may want to put the application and the command line parameters into a seperate script eg:
Application -option -option
And then call this seperate script:
#! /bin/sh
rxvt -e your_script
P.S
I use ROX file manager to change scripts to executable using right_click->permissions.
|
|
Back to top
|
|
 |
puppian

Joined: 18 Jul 2005 Posts: 538 Location: PuppyLand
|
Posted: Fri 22 Jul 2005, 15:05 Post subject:
|
|
Thanks for the tips, but that gives the same result...
After trying and trying I was lucky enough to get it work finally by typing this:
#!/bin/sh
cd /root
rxvt -e mp3blaster -a mylist.lst
I don't know why this works, maybe it's something about permission
|
|
Back to top
|
|
 |
|