LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-22-2005, 11:44 AM   #1
slackwarebilly
Member
 
Registered: Jun 2005
Distribution: !<:Slackware:>!
Posts: 99

Rep: Reputation: 15
Smile way to *click* launch apps


Does anybody know of a way besides a kde "Link to application" to launch a shell script by clicking on somehthing, thanks,

slackwarebilly
 
Old 07-22-2005, 01:32 PM   #2
geeman2.0
Member
 
Registered: Feb 2005
Location: Ontario, Canada
Distribution: Gentoo, Slackware
Posts: 345

Rep: Reputation: 30
How about a GNOME link to application?

I don't think I'm sure what you're asking.
 
Old 07-22-2005, 02:10 PM   #3
slackwarebilly
Member
 
Registered: Jun 2005
Distribution: !<:Slackware:>!
Posts: 99

Original Poster
Rep: Reputation: 15
Unhappy confirm

is it true that you can set a BASH script executable and just click to launch?

slackwarebilly?
 
Old 07-22-2005, 03:30 PM   #4
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
You can create a launcher in Gnome that launches the terminal then executes a command. See man gnome-terminal (or man xterm if you prefer). They both have switches to execute code after loading.

As an example, I have shortcuts to ssh to all of my servers. The command looks like this:
Code:
gnome-terminal --command="ssh server1.mydomain.com" --geometry=140x40+0+0
The geometry stuff makes the window bigger since I find the gnome-terminal default size a bit puny.
 
Old 07-22-2005, 05:57 PM   #5
slackwarebilly
Member
 
Registered: Jun 2005
Distribution: !<:Slackware:>!
Posts: 99

Original Poster
Rep: Reputation: 15
Exclamation I don't use gnome

Any idea how to do it across all distro's?

question will this work...

making a shellscript executable seems to work, but ti is silent.

can I launch a console with with the script and then execute coomands automatically in that console?

thanks,

slackwarebilly
 
Old 07-22-2005, 06:41 PM   #6
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
Quote:
can I launch a console with with the script and then execute coomands automatically in that console?
Stop, deep breath, and tell us what you are trying to do exactly...

If you have a running shell script, and you want to open a terminal and do something in it, then here's how:
Code:
#!/bin/bash
# some random code here
xterm -e echo "Here's some text in a xterm\!"
However if someone runs that from outside X it'll crap out cause is won't be able to find the display. If you want to make a script executable, just chmod it:
Code:
chmod a+x /path/to/script.sh
However, with default permissions, most file managers won't run it if double-clicked as that would be a great way to distribute malicious code. Konqueror and Nautilus will both as to Run or Display in a text editor. ROX won't do anything if you have made an association with the mime type.

Last edited by cs-cam; 07-22-2005 at 06:42 PM.
 
Old 07-23-2005, 11:13 AM   #7
slackwarebilly
Member
 
Registered: Jun 2005
Distribution: !<:Slackware:>!
Posts: 99

Original Poster
Rep: Reputation: 15
thanks

I already know the chmod stuff, and it's not something in particular I'm talking about it's a program I'm developing with some other poeple in the community. What about launching a binary with a click.. you know in kde it looks like a gear (is an executable file)... and to be specific, it is a binary compiled by a C++ script..

thanks all, I'll try the xterm thing

slackwarebilly
 
Old 07-25-2005, 02:34 PM   #8
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
In KDE, as far as I know, the executable does what you expect it to simply because Konqueror is configured to do that. There's no way to say that a file is going to do what you want when it's clicked by someone else on another system, using a different configuration and possibly a different file manager. The best you can do is make it executable and leave it up to the user to decide how to launch it.
 
Old 07-26-2005, 11:25 AM   #9
slackwarebilly
Member
 
Registered: Jun 2005
Distribution: !<:Slackware:>!
Posts: 99

Original Poster
Rep: Reputation: 15
I'll ask the guys at autopackage, they do it... somehow

thanks all,

slackwarebilly
 
Old 07-27-2005, 05:05 AM   #10
mhearn
LQ Guru
 
Registered: Nov 2002
Location: Durham, England
Distribution: Fedora Core 4
Posts: 1,565

Rep: Reputation: 57
autopackages are simply shell scripts that are made +x. Internally, if there is no tty associated then we re-exec the script inside a terminal emulator. Various heuristics are used to determine whether to run xterm, gnome-terminal, konsole or something else. Once the bootstrap procedure has been completed (ie, autopackage is installed) then a fully graphical frontend is available and the shell scripts invoke that instead.

Simple, really.
 
Old 07-27-2005, 11:11 AM   #11
slackwarebilly
Member
 
Registered: Jun 2005
Distribution: !<:Slackware:>!
Posts: 99

Original Poster
Rep: Reputation: 15
Talking thx,

So we just write a script to find the term they are using, thanks,

slackwarebilly
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't launch X-apps as super user Optimistic Debian 3 09-18-2005 12:05 PM
how to launch apps in a new x display? zero79 Debian 8 06-29-2005 09:58 PM
key combinations to launch apps? will103 Linux - Software 2 09-11-2004 02:55 PM
Menu troubles: apps do not launch; unable to add apps hfinger Mandriva 1 08-22-2003 04:49 AM
Can't launch X apps when 'su'd as another user davee Linux - Newbie 3 08-17-2003 11:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration