# Linux – X on one monitor, a bare, tty terminal on another? (linux)

displaylinuxttyxorg

The graphics card on my computer has outputs for (at least) two separate monitors. I have one monitor that is high resolution, and I like using it for X (anything graphical). My other monitor, however, is an OLD, low resolution, flat-panel monitor.

I'm wondering if it's possible to configure the monitors so that the tty terminal running X goes to monitor A (the high resolution monitory), and /dev/tty2, just running the bash shell, goes to B (the lower resolution monitor).

Would I use an xorg config file for this? I'm really not sure.

The problem you have with running the setup you mention is the keyboard. The keyboard will be captured by the x server running on your primary display (high-res). You will not be able to switch to the other terminal if you would like to type something in it.

Even if your secondary monitor is low resolution, you could run an xterm session on it that's separate from your main x screen. You will want to setup the 2 displays as completely different screens (not using xinerama). You will end up with 0.0 and 0.1 displays. Your primary display would be the 0.0 whereas your DISPLAY environment variable will be as follows:

export DISPLAY=:0.0


This configuration will allow you to move your mouse between the 2 screens to choose where your keyboard input will be passed. In your .xinitrc (in your home dir), you could then do something as follows:

#!/bin/bash
xsetroot -solid black
xsetroot -display :0.1 -solid darkblue
xterm -display :0.1 -fn 9x16 -geometry 86x36+1+1 &
startkde


This would start by setting the background of your primary display to black. Next it will set your secondary display background to darkblue (I use this color because I use my secondary screen for watching movies). Next line starts an xterm on your second display with a preset geometry. You will want to adjust the geometry to fit your screen the best for you. You cannot specify pixel width and height because the geometry for xterm measures in characters. If you choose the 9x16 font size as in my example and your secondary screen resolution is 800x600, you would do the following math:

font size = 9x16
screen size = 800x600
xterm width = ( 800 / 9 ) = 88.888
xterm height = ( 600 / 16 ) = 37.5


You want to round the number down some, especially for the width since you need to account for a scrollbar. You will not have a window manager on the secondary screen so there will be no xterm window title (unless you choose to run something light on the second monitor such as twm or fvwm). Basically, you will have to play with the numbers til you get it how you want it.

The last line in the .xinitrc file will launch the main window manager on your primary display. You can change this to gnome-session or whatever launches your favorite wm. You could also modify the existing .xinitrc for your distribution if you wish to preserve the ability to choose your window manager during login. There should be a skeleton file in your /etc/X11 for using as a base.

UPDATE:

Modern versions of KDE will control all screens now. You no longer need to maintain a separate window manager on the second screen. Not sure about the gnome wm since I don't use gnome.