LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   way to *click* launch apps (https://www.linuxquestions.org/questions/linux-general-1/way-to-%2Aclick%2A-launch-apps-345738/)

slackwarebilly 07-22-2005 11:44 AM

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

geeman2.0 07-22-2005 01:32 PM

How about a GNOME link to application? ;)

I don't think I'm sure what you're asking.

slackwarebilly 07-22-2005 02:10 PM

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

slackwarebilly?:confused:

TruckStuff 07-22-2005 03:30 PM

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.

slackwarebilly 07-22-2005 05:57 PM

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

cs-cam 07-22-2005 06:41 PM

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.

slackwarebilly 07-23-2005 11:13 AM

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

mikshaw 07-25-2005 02:34 PM

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.

slackwarebilly 07-26-2005 11:25 AM

I'll ask the guys at autopackage, they do it... somehow
 
thanks all,

slackwarebilly :D

mhearn 07-27-2005 05:05 AM

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.

slackwarebilly 07-27-2005 11:11 AM

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

slackwarebilly :D


All times are GMT -5. The time now is 05:42 PM.