Quote:
Originally Posted by MTK358
I never thought that's possible! How do you do it?
|
Change (or create) files in your home directory with names in the form
.Xclients-{domain}:{n} where "domain" is the host-name of your system (i.e., the second word in the
uname -a output, or just run the
hostname command), and {n} is the X server number. Each file should be a
bash script telling the X-server how to start the window manager for the GUI you want on screen {n}. The just open a terminal and run the command
startx -- :{n} &>/dev/null &;disown to start a X server on
tty{((n+6))}. Note that you need some server flag options set in
xorg.conf or
xorg.conf.d/for this to work.
Here's what my
.Xclients scripts look like:
Code:
$ ls .X*
.Xauthority .Xclients-default .Xclients-dv9810us:1 .Xclients-dv9810us:3
.Xclients .Xclients-dv9810us:0 .Xclients-dv9810us:2
$ cat .Xclients-dv9810us\:*
#! /bin/bash
WM="startkde"
WMPATH="/usr/bin /usr/X11R6/bin /usr/local/bin"
for p in $WMPATH
do
[ -x $p/$WM ] && exec $p/$WM
done
exit 1
#-----------------------------------------------
#! /bin/bash
WM="gnome-session"
WMPATH="/usr/bin /usr/X11R6/bin /usr/local/bin"
for p in $WMPATH
do
[ -x $p/$WM ] && exec $p/$WM
done
exit 1
#-------------------------------------
#! /bin/bash
WM="startxfce4"
WMPATH="/usr/bin /usr/X11R6/bin /usr/local/bin"
for p in $WMPATH
do
[ -x $p/$WM ] && exec $p/$WM
done
exit 1
#------------------------------------
#! /bin/bash
WM="karmen"
WMPATH="/usr/bin /usr/X11R6/bin /usr/local/bin"
for p in $WMPATH
do
[ -x $p/$WM ] && exec $p/$WM
done
exit 1
Alternatively, you could set a default
.Xclients file like this:
Code:
$ cat .Xclients-default
#!/bin/bash
#
# Set the default display manager to KDE
#
DefaultManager=KDE
#
# Read the preferred display manager name from /etc/sysconfig/desktop if possible
# otherwise use the default
#
if [ -x /etc/sysconfig/desktop ];
then
. /etc/sysconfig/desktop
else
DISPLAYMANAGER=$DefaultManager
fi
[ -z $DISPLAYMANAGER ] && DISPLAYMANAGER=$DefaultManager
#
# Get the window manager executable name for the specified DISPLAYMANAGER value
#
case $DISPLAYMANAGER in
KDE)
WM="startkde";;
GNOME)
WM="gnome-session";;
XFCE)
WM="startxfce4";;
KARMEN)
WM="karmen";;
ICE)
WM="icewm";;
OPEN*)
case $DESKTOP in
GNOME)
WM="openbox-gnome-session";;
KDE)
WM="openbox-kde-session";;
*)
WM="openbox";;
esac;;
METACITY)
WM="metacity";;
TWM)
WM="twm";;
WMAKER)
WM="wmaker";;
FLUXBOX)
WM="fuxbox";;
FVWM)
WM="fvwm";;
*)
WM=$DefaultManager;;
esac
#
# Locate the window manager and start it
#
manager=$(whereis -b $WM | cut -d' ' -f2)
[ -x "$manager" ] && exec $manager
#
# If we get here the specified window manager could not be found
#
exit 1
And here's the server flag section you'll need in
xorg.conf or
xorg.conf.d/
Code:
Section "ServerFlags"
Option "DontZap" "off"
Option "DontVTSwitch" "off"
EndSection
(See
man xorg.conf for details.)