LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Xterm or Konsole to 1:open, 2:position, 3:initialize multiple terminals in an order (https://www.linuxquestions.org/questions/linux-newbie-8/xterm-or-konsole-to-1-open-2-position-3-initialize-multiple-terminals-in-an-order-785411/)

linux_newb_help_wanted 01-28-2010 12:52 PM

Xterm or Konsole to 1:open, 2:position, 3:initialize multiple terminals in an order
 
Hey guys,

I have never worked with linux before, so I'm coming here for advice on this task.

I need to open multiple terminals, position them about the screen (so they will all be open simultaneously), and send arguments to them in a certain order....

Some of the software people I know pointed me in the direction of Xterm and Konsole. I'm supposed to write a script that uses one of those.....

Any/all information or pushes in the right direction would be greatly appreciated!

Tinkster 01-28-2010 08:22 PM

Hi, welcome to LQ!

Can you please elaborate on the task(s)?

Quote:

and send arguments to them in a certain order....
Opening (positioning) terminals is going to be a feature of the
DE/WM of choice, not the terminal application.

What are you going to do to those terminals, are they all supposed
to be running stuff on the local machine, do you want to do the
same command on varied machines?

Quote:

Any/all information or pushes in the right direction would be greatly appreciated!
So far it's just questions because your specs aren't very clear.



Cheers,
Tink

zrdc28 01-30-2010 06:01 PM

All you need to do is click on konsole icon 3 times!

evo2 01-30-2010 11:44 PM

I don't know about "sending commands" to a terminal, but you can get the terminal to run something when it opens.

Eg.
Code:

xterm -geometry +100+200 -e top
Here th 100 and 200 specify the horizontal and vertical distance from the top left corner of the screen.

Evo2.

worm5252 01-31-2010 12:04 AM

We really do need more information. What do you have to do? how many terminals do you need? where do they need to be placed? why do you need more than 1 terminal?

linux_newb_help_wanted 02-02-2010 07:38 AM

--------------------------------------
-----To: Tinkster
--------------------------------------

Thank you for the welcome! was very happy to find this place!

What I meant by "sending arguments to them in a certain order" is that once the multiple
terminals are open simultaneously, let's say...there are 9 shells positioned neatly on
screen, at that point, I need to send a specific set of commands to the shell thats in
upper left, then a DIFFERENT set of specific commands to the shell beneath that...
so on and so forth. This means I'll need some way to identify each shell, and send ...
shell named Bob his doughnut, and shell named Sally her coffee....

Tinkster: "Opening (positioning) terminals is going to be a feature of the
DE/WM of choice, not the terminal application."

I will be looking into that. As far as I'm concerned, I'll deal with the positioning once
all the important things are taken care of...like getting the shells open in the first place.

Tinkster: "What are you going to do to those terminals, are they all supposed
to be running stuff on the local machine, do you want to do the
same command on varied machines?"

I'm going to run a different program on each terminal, but they all need to be running at
the same time....I know it sounds ridiculous...I didn't write the programs, I'm just
trying to tie them together. Yes, they will be running things on a local machine, so
we dont want to do the same command on varied machines.

Completely agree with your philosophy btw, thanks for responding!


--------------------------------------
-----To: zrdc28
--------------------------------------

I'm supposed to be writing a script file, so clicking isn't an option for me :(

--------------------------------------
-----To: evo2
--------------------------------------

Thank you! This will be very helpful!

--------------------------------------
-----To: worm5252
--------------------------------------

worm5252: "What do you have to do?" write a shell script to open/initialize multiple terminals
worm5252: "how many terminals do you need?" 9 terminals

worm5252: "where do they need to be placed?"

screen:
--------------
|_1________|
|_2______6_|
|_3______7_|
|_4______8_|
|_5______9_|
--------------

worm5252: "why do you need more than 1 terminal?"

each terminal needs to be running its own program
each program execution process needs to be monitored


--------------------------------------
-----To: ALL
--------------------------------------

I'm playing with Xterm this morning, tryin to write a beginners script file to just open
a single terminal and position it. I'll keep you guys posted if I stumble upon any
good info on the web today, or make any significant progress!

linux_newb_help_wanted 02-02-2010 09:01 AM

-----------------------------------------------------
-------------------STATUS REPORT:--------------------
-----------------------------------------------------

xterm wont seem to run the multiple shells at the same
it runs them...but i have to close the 1st shell in order to make the 2nd pop up,
close the 2nd one to make the 3rd one pop up....ect

//the first geometry property positions the shell, the 2nd sizes it
#xterm -geometry +10+20 -geometry 100x10
#xterm -geometry +50+200 -geometry 100x10
#xterm -geometry +50+400 -geometry 100x10
#xterm -geometry +50+600 -geometry 100x10


konsole seems most promising so far,
it will allow multiple shells to run at the same time, and i can title them
but i can't seem to position them about the screen

#konsole --nomenubar --notabbar -T shell_#1 --vt_sz 30x10 &
#konsole --nomenubar --notabbar -T shell_#2 --vt_sz 30x10 &
#konsole --nomenubar --notabbar -T shell_#3 --vt_sz 30x10 &
#konsole --nomenubar --notabbar -T shell_#4 --vt_sz 30x10


also.......i found a forum where the person was tryin to do the same exact thing as I'm tryin to do,
and someone posted ...what MIGHT be a solution, but I'm too unfamiliar with it to make any sense out of it

site: http://nixcraft.com/shell-scripting/...terminals.html

//the person responding to the solution wrote the code below...i have no idea what gnome-terminal is, and couldn't get this code to run on my side
//this look familiar to anyone?....seems like it could be handy because he's able to send commands to the specific terminals

#!/bin/sh
gnome-terminal --hide-menubar --title="Terminal # 1" -x sh -c "date|less"
gnome-terminal --hide-menubar --title="Terminal # 2" -x sh -c "ls -l /etc|less"

linux_newb_help_wanted 02-02-2010 10:34 AM

-----------------------------------------------------
-------------------STATUS REPORT:--------------------
-----------------------------------------------------

moving forward!

xterm is correctly sizing, positioning, and opening multiple shells simultaneously

#optimized for 1280x1024
xterm -geometry 100x10+10+75 & #shell#1
xterm -geometry 100x10+10+250 & #shell#2
xterm -geometry 100x10+10+425 & #shell#3
xterm -geometry 100x10+10+600 & #shell#4
xterm -geometry 100x10+10+775 & #shell#5
xterm -geometry 100x10+650+250 & #shell#6
xterm -geometry 100x10+650+425 & #shell#7
xterm -geometry 100x10+650+600 & #shell#8
xterm -geometry 100x10+650+775 #shell#9

CURRENT GOALS
1. get a title for each shell (ex: shell#1, shell#2...ect)
2. send each shell a specific argument
.....i've been trying to send an echo command to the top leftmost shell with no success...

evo2 02-03-2010 12:24 AM

For title you can use the '-T' flag for xterm

Code:

xterm -T "Terminal title"
I think you can learn quite a bit by reading the xterm man page.

Cheers,

Evo2.


All times are GMT -5. The time now is 02:20 PM.