Page 1 of 1

Help, bash

Posted: Mon Jul 09, 2012 3:32 am
by jack_addy
Uh, I wouldn't decide wether to post this in the off-topcic section or the FAQ section as it has nothing to do with kreatious... :/

Before I begin I must say: I am on a linux.

Ok so I've just written a bash to just type in ./kreatious in the terminal and it will open minecraft and teamspeak and firefox to kreatious.net.

I set it up like this.

#/bin/bash
clear
echo Starting TeamSpeak3...
cd ~/TeamSpeak3-Client-linux_x86
./ts3client_runscript.sh
echo Starting Minecraft.jar...
cd ~/Desktop
java -jar minecraft.jar
echo Starting FireFox
firefox

It runs fine but It doesn't launch minecraft. Reason being it can not run two programs in the terminal at once.
So I appear with firefox, and teamspeak. As soon as a close teamspeak allowing space in the terminal for the java command minecraft starts up. So how do I get it to open up another terminal and run minecraft at the same time.

I can do gnome-terminal at the very top in the bash text but I don't know how to get it to open up with a command. :/ someone help.

Edit I found the command to do that. gnome-terminal -e "java -jar minecraft.jar" while teamspeak runs in the first terminal. Firefox is an application so it doesn't run in the terminal. But the command gnome-terminal -e "java -jar minecraft.jar" crashes the terminal almost as soon as it goes up. I have tried other commands like gnome-terminal -e "ping http://www.google.com" and it does not crash. I have not tried opening up an xterm or konsole yet.

Re: Help, bash

Posted: Tue Jul 10, 2012 5:12 am
by jack_addy
Ok so, ive finished it. It runs good but im still trying to make the terminals dissappear to make it less cramped but it works fine. the final code is (not color coded):


#!/bin/bash
clear
gnome-terminal -x java -cp ~/Desktop/minecraft.jar net.minecraft.LauncherFrame
echo Starting FireFox...
firefox &
echo Starting TeamSpeak3...
gnome-terminal -x ~/TeamSpeak3-Client-linux_x86/ts3client_runscript.sh


I may add it so it opens up to the kreatious tab for firefox but that might be hard.

Locked and archived?