Date: Fri, 21 Jan 2000 23:42:33 GMT From: Salvo Bartolotta <bartequi@nojunk.com> To: c4_b2@yahoo.com Cc: questions@FreeBSD.ORG Subject: Re: x-windows: how to play with multiple X sessions etc.: a simple recipe ? Message-ID: <20000121.23423300@bartequi.ottodomain.org> References: <20000120224324.29071.qmail@web119.yahoomail.com> <20000121.83900@bartequi.ottodomain.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Dear Sir (or Madam ??), I add some more details to the solution outlined yesterday. I will limit myself to the case in which X is invoked from within a CUI shell; which, incidentally, is a most flexible choice. To begin with: CUI=3D=3DCharacter User Interface. A simple way to switch between e.g. Gnome and KDE is to define the following files (" ~ " stand for your home directory): 1) ~/.xinitrc_gnome, containing just one line: "exec gnome-session" ; 1A) the script (executable) ~/g, so defined (in csh shell): #!/bin/csh # in order for the script to be executed from any # directory: cd ~ # the following "if" instruction checks if the last graphical #environment was Gnome in order to avoid a useless write operation; if #the last GUI was *not* Gnome, then the symlink .xinitrc is created #and points at .xinitrc_gnome. if (`ls -l .xinitrc | grep .xinitrc | awk '{print $11;}'` !=3D .xinitrc_gnome) then # from "if" to "then" stays in *one* line ln -fs .xinitrc_gnome .xinitrc endif # the command actually starting X on screen 0, vt 9 # you need to turn at least *two* consoles off in /etc/ttys # if you want to run *two* GUIs simultaneously. startx -- :0 vt9 #please note: 0 is the "display". ###################### end of sample script ######################### Similarly: 2) ~/.xinitrc_kde, containing just one line: "exec startkde" ; 2A) the script (executable) ~/k, so defined (in csh shell): #!/bin/csh cd ~ if (`ls -l .xinitrc | grep .xinitrc | awk '{print $11;}'` !=3D .xinitrc_kde) then # from "if" to "then" stays in *one* line ln -fs .xinitrc_kde .xinitrc endif startx -- :1 vt10 ###################### end of sample script ######################### If you issue " ./k " in your home directory, you will start KDE; " ./g " will start Gnome. Remark. You can start more GUIS simultaneoulsy provided that: i) the displays are *different* ; ii) the " vt " are *different* ; For example, I can run even four GUIs simultaneoulsy, as four *different users*; each having its own locale (e.g. US English, French, German, Italian); each having a different "display" (:0 , :1, :2 ...) and correspondingly different Vts (e.g. vt9 <-> :0, vt10 <-> :1, ...) Please note: vtXX <---> Function key XX. vt 9, 10, 11, 12 can work in that /etc/ttys has consoles 8,9,a,b turned off. Attention: the consoles in ttys start from "0". You could also e.g. launch *another* GUI session (e.g. Gnome) **within** KDE, provided the displays and Vts are appropriately defined (as in our sample scripts)... Just start it in a terminal window. Exiting the second GUI will take you back to the first. Finally, you can switch (via CTRL-ALT-Function keys) between the various GUIs, whether or not they belong to different users. If you prefer tcsh, the two little scripts above simplify, e g. 2A) becomes: #!/usr/local/bin/tcsh if (-L .xinitrc !=3D .xinitrc_kde) ln -fs .xinitrc_kde .xinitrc startx -- :0 vt9 ###################### end of sample script ######################### Of course, you must have installed tcsh for this script to work. I hope this information will help. The sole limit is now only your RAM ... Yours faithfully Salvo Bartolotta To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000121.23423300>