Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Desktop Links and XTerm, How do i open xterm and give it commands< Next Oldest | Next Newest >
SuperLou Offline





Group: Members
Posts: 124
Joined: April 2005
Posted: May 23 2005,22:26 QUOTE

I'm trying to make a desktop link that will start shoutcast server.  Currently I can make the link open xterm via:
Code Sample

Command: rxvt -T "SHOUTCast Server" -e /opt/shoutcast-1-9-5-linux-glibc6/sc_serv

However, when I activate the link from the desktop the server starts but cannot find the location of sc_serv.conf which is in the same dir as sc_serv.  Is there a way to use a link to pass xterm a set of commands on activation?

I think that I might be able to start a script using a link maybe?  I need to start the server in xterm so I can see the output display.  Once I've closed xterm i can't see the output stats but the ps keeps running.  It would be nice if i could lookup the stats after i have closed the xterm.

If anyone could help me with any of this I would greatly appreciate it.

Thanks,
Louis
Back to top
Profile PM WEB AOL 
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: May 23 2005,23:35 QUOTE

SuperLou, yes you can do what you want to do.  You need to use bash as the program that rxvt is running, then use bash's init file to take you the rest of the way.  The *.lnk line would look like this:

Code Sample
Command: rxvt -rv -T "Test Case" -e /bin/bash --init-file /home/dsl/burble


The burble file would look like this:

Code Sample
PS1='\u@\h:\w\$ '
export PATH=$PATH:/opt/shoutcast-1-9-5-linux-glibc6
/opt/shoutcast-1-9-5-linux-glibc6/sc_serv


The PS line sets the prompt of the bash shell.  I copied it from the default bash init so it looks the same.

The export line sets the PATH variable to include the directory where the conf file is (it sounded like shoutcast had trouble finding it, so why not let it know where to look?).  The last line runs you program.  When it's done, the window stays open because bash is still running.  This is nice for debugging since you can work in that window if you want.

You can put the special bash init file anywhere and call it anything you want, as long as you put the path to it in the command.
Back to top
Profile PM 
1 replies since May 23 2005,22:26 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: Desktop Links and XTerm

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code