Archive

Multiple X

I was recently trying to protect my desktop from my son who loves to come in and play with Tux Paint. This app runs very small on my screen (1600×1200) and it is not possible to resize it unfortunately. If I change the screen resolution the desktop size stays the same and results in the screen scrolling when the mouse hits the edge. This drove my son up the wall (he’s only 3 1/2). Possibly more importantly I wanted to protect my running applications (so no odd messages in IRC or closed applications etc.), so…

It is easy enough to start another X session in a different screen using something like:

startx — :1

That protects my applications, but does nothing for the resolution issues, so after a bit of digging I found that with later versions of X you can point to a different config file. After a quick copy and edit of the XF86Config-4 I ended up with a XF86Config-4_aaron (which basically matched the original, but only ran at 800×600 – much nicer for Tux Paint). The new config file has to live in the same directory as the original (so /etc/X11/ for me), and then you can start X with the command:

startx — :1 -xf86config XF86Config-4_aaron

or whatever you named the file.

Just in case you’ve got this far and are wondering how to switch between the screens, you use CTRL-ALT and a function key. Standard stuff, but there are all levels on this list. So as a quick recap of this…

When you initially log in you are on F1 (using the matching function key to identify the screen for convenience). When you start X you leave this running (and can switch bag to see messages logged to the console) and move to F7. By using CTRL-ALT-F2 I switch to another console and login as Aaron. I then use the command above (which I have put into a one line script so I can easily remember it!) to kick of an X session on F8.

So CTRL-ALT-F7 and CTRL-ALT-F8 switch me between my own and my sons desktops. I’m safe so long as he doesn’t learn that key combination :-)

Of course if I setup a screensaver on my session then this won’t be an issue.

OK, that’s basically a cut and paste from my post to the list.

I’ll see if I can improve things for this Wiki page a bit later. – PaulTansom

Leave a Reply