PDA

View Full Version : using xterm to split text-based screen into 4



greenbag
07-26-2007, 11:21 PM
I've been able to start 4 programs at once in text mode, but I'd like to be able to split the screen into 4 separate windows, each with it's own output (upper left 1/4, upper right 1/4, bottom left 1/4, and bottom right 1/4).

I started trying with 'newwin':


newwin(12, 39, 0, 0)
newwin(12, 39, 0, 40)
newwin(12, 39, 13, 0)
newwin(12, 39, 13, 40)

But I'm getting syntax errors.

Somebody suggested 'xterm -e program', so I tried:


xterm -e ./1.sh &
xterm -e ./2.sh &
xterm -e ./3.sh &
xterm -e ./4.sh

But now it tells me 'xterm command not found' - is xterm not usable in knoppix?

Or, is there a different way I should be trying?

thanks in advance :)


gb

greenbag
07-27-2007, 12:08 AM
think I found the issue....

If I type 'xterm' in a terminal from the desktop, a smaller terminal pops up. But if I type 'xterm' from root prompt in text mode, I get a warning that 'xterm' can't be used as root(?).

So, what's the best way around this?

greenbag
07-27-2007, 01:57 AM
forgot to add the message:



Warning: This program is an suid-root program or is being run by the root user. You may get a more descriptive message by running the program as a non-root user or by removing the suid bit on the executable.

xterm Xt error: Can't open display: %s


I even booted to the desktop, then opened terminal and 'sudo init 3', then ran my script - but still gives the same message.


ps:

I just realized I posted in wrong section.... sorry about that - feel free to move.


gb

greenbag
07-28-2007, 04:40 AM
got it.....

the main issue, is I was in runlevel 3 - there's no x in runlevel 3 :roll:

but, I figured it out with openvt:

openvt -s ./1.sh &
openvt -s ./2.sh &
openvt -s ./3.sh &
openvt -s ./4.sh

then, to alternate between virtual terminals:

ctrl+alt+F2 = vt1
ctrl+alt+F3 = vt2
ctrl+alt+F4 = vt3
ctrl+alt+F5 = vt4

ctrl+alt+F1 brings you back to the original terminal, displaying the root prompt - ready for anything else you need to do.


cheers :D