Link to home
Start Free TrialLog in
Avatar of tmonteit
tmonteitFlag for Afghanistan

asked on

Configuring Gnome-Terminal

In ubuntu linux, I have a script that opens two terminals.  How do I print a seperate message into each terminal and put them into a specific directory?
!/bin/bash
gnome-terminal --geometry 90x26+200+10
gnome-terminal --geometry 30x8+700+500

Open in new window

Avatar of wesly_chen
wesly_chen
Flag of United States of America image

> put them into a specific directory
gnome-terminal --geometry 90x26+200+10 --working-directory=/dir1
gnome-terminal --geometry 30x8+700+500 --working-directory=/dir2
Here are some advanced usage of gnome-terminal
How to automate starting terminal instances for specific tasks
http://askubuntu.com/questions/2538/how-to-automate-starting-terminal-instances-for-specific-tasks

Customize and use Gnome Terminal profiles
http://ubuntuforums.org/showthread.php?t=1347856
Avatar of José Méndez
José Méndez

To send messages to the consoles you may try to obtain the pts number for each console, for example if you run:

who am i
user    pts/3        2011-05-05 00:24 (:0.0)

Then you need to extract the pts/3, and use it like this:

echo "Your message" > /dev/pts/3

Hope it helps
Avatar of tmonteit

ASKER

I'm making progress...  The only problem is that when I try to display my message the window automatically closes.  

gnome-terminal -e "cat my-message.txt"  

How do I keep the window open with the bash-prompt after I display my-message?
You need to create a new profile.
Open a terminal and select Edit -> Profiles. Add a new profile and name it 'term1'
Then edit the "term1" profile, in the "Title and Command" tag, in pull-down menu for "When command exits:" choose "Hold the terminal open".

Then
gnome-terminal --profile=term1

ASKER CERTIFIED SOLUTION
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
worked perfect!!!
Great.

If my 1st and 3rd comments helpful, please click on "yes" for those comments.
This will make the other subscribers easy to locate the solution.