Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 23 Nov 2014, 16:24
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How do I run a shell command when icon clicked? (Solved?)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [6 Posts]  
Author Message
penguinman007
Guest


PostPosted: 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: 11157
Location: Arizona USA

PostPosted: Tue 19 Jul 2005, 23:33    Post subject:  

Just to be sure, you have read this post, right?
Back to top
View user's profile Send private message 
prnguinman007
Guest


PostPosted: 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

PostPosted: 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
View user's profile Send private message Visit poster's website 
Guest
Guest


PostPosted: 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

PostPosted: 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 Confused
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0599s ][ Queries: 12 (0.0077s) ][ GZIP on ]