LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-28-2010, 12:52 PM   #1
linux_newb_help_wanted
LQ Newbie
 
Registered: Jan 2010
Posts: 4

Rep: Reputation: 0
Exclamation 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!
 
Old 01-28-2010, 08:22 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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
 
Old 01-30-2010, 06:01 PM   #3
zrdc28
Member
 
Registered: Dec 2007
Location: Alabama USA
Distribution: Slackware current
Posts: 299

Rep: Reputation: 53
All you need to do is click on konsole icon 3 times!
 
Old 01-30-2010, 11:44 PM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
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.
 
Old 01-31-2010, 12:04 AM   #5
worm5252
Member
 
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567

Rep: Reputation: 57
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?
 
Old 02-02-2010, 07:38 AM   #6
linux_newb_help_wanted
LQ Newbie
 
Registered: Jan 2010
Posts: 4

Original Poster
Rep: Reputation: 0
--------------------------------------
-----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!

Last edited by linux_newb_help_wanted; 02-02-2010 at 07:43 AM.
 
Old 02-02-2010, 09:01 AM   #7
linux_newb_help_wanted
LQ Newbie
 
Registered: Jan 2010
Posts: 4

Original Poster
Rep: Reputation: 0
-----------------------------------------------------
-------------------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"
 
Old 02-02-2010, 10:34 AM   #8
linux_newb_help_wanted
LQ Newbie
 
Registered: Jan 2010
Posts: 4

Original Poster
Rep: Reputation: 0
-----------------------------------------------------
-------------------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...
 
Old 02-03-2010, 12:24 AM   #9
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Colors on Konsole and xterm Geriao Slackware 2 12-24-2009 05:26 PM
default behavior for Konsole and other x-type terminals muttdawg Slackware 5 09-02-2007 05:31 PM
Open several terminals in konsole jorgelon Linux - Software 9 11-01-2004 03:05 AM
konsole terminals not closing ARGGG! ptesone Debian 4 03-19-2004 12:20 PM
Bash Prompts with xterm-style terminals somnium Linux - General 1 09-11-2003 08:43 AM


All times are GMT -5. The time now is 12:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration