-   Linux - Software (
-   -   desktop shortcut for a terminal prompt (

mannoulla 06-04-2004 09:33 AM

desktop shortcut for a terminal prompt
to open an application which i have just written in java, i have to write a very long prompt in a terminal (java -jar ~/manal/ -channels 1 -prompts prompts.txt) - i'm using fedora 2

Is there a way I can add a shortcut icon on the desktop that would open this same application (without me having to open a terminal and typing the prompt each time i want to open this application)?



Ironica 06-04-2004 10:51 AM

In which window manager?

It's easy to do in KDE, just right click -> new -> link to application, and type the command. It's probably similar for many others too.

mikshaw 06-04-2004 09:55 PM

You could put an alias in .bashrc (if you're using bash):
alias prompts='java -jar ~/manal/ -channels 1 -prompts prompts.txt'
and then just type "prompts" in a terminal.

mannoulla 06-07-2004 09:21 AM

what about I need 2 commands?
the way the data structure of the application i'm using:
i need to open two terminals:

in one, I type
% cd address
% ./rec.csh

and in the other, I type

%cd address
% ./audio.csh

for the application window to open and start working.
Is there any way i can create a shortcut for this particular application?

mikshaw 06-07-2004 10:26 AM

I'm not sure about the shell you're using, but in Bash you can separate commands within a single line by using semicolons.

Another option is creating a function or a script.

mannoulla 06-07-2004 10:34 AM

where can i learn more about that (writing scripts or functions)?
what directory should i save them too...



mikshaw 06-07-2004 10:38 AM

As I said, I don't know any shell other than Bash....writing functions and scripts are dependent upon your shell.

Bash scripting:

The directory in which you save script can be anywhere, but it's most convenient to use a directory in your path. Personally I have a ~/scripts directory which I've added to my path.
Functions are typically added to a shell startup script such as .bashrc, where they can be accessed from anywhere. You could think of a function as an extended alias.

Lleb_KCir 06-07-2004 01:16 PM

read down that thread. it will tell you what steps to take to do what you are looking for.

i had the same question and thankfuly this site has a very powerful working serch tool so i can just serch for my user name and find this thread when ever i need to repeat these steps.

mannoulla 06-07-2004 01:47 PM

I tried to do something similiar, but it's not working.

the problem is, semi-columns between commands (cd address; ./rec.csh) doesn't work

please help!


Lleb_KCir 06-07-2004 02:05 PM

hmm sorry... you might want to try asking a simular question in the programming forum. or have a mod move it there.

All times are GMT -5. The time now is 01:09 AM.