From owner-freebsd-questions Fri Jan 21 15:41:34 2000 Delivered-To: freebsd-questions@freebsd.org Received: from aragorn.neomedia.it (aragorn.neomedia.it [195.103.207.6]) by hub.freebsd.org (Postfix) with ESMTP id F2CE915848 for ; Fri, 21 Jan 2000 15:41:08 -0800 (PST) (envelope-from bartequi@nojunk.com) Received: from bartequi.ottodomain.org (ppp59-pa4.neomedia.it [195.103.207.251]) by aragorn.neomedia.it (8.9.3/8.9.3) with SMTP id AAA30301; Sat, 22 Jan 2000 00:40:44 +0100 (CET) From: Salvo Bartolotta Date: Fri, 21 Jan 2000 23:42:33 GMT Message-ID: <20000121.23423300@bartequi.ottodomain.org> Subject: Re: x-windows: how to play with multiple X sessions etc.: a simple recipe ? To: c4_b2@yahoo.com Cc: questions@FreeBSD.ORG References: <20000120224324.29071.qmail@web119.yahoomail.com> <20000121.83900@bartequi.ottodomain.org> X-Mailer: Supercalifragilis X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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