How To Replace GNOME with KDE

Phil Mattison plug-discuss@lists.plug.phoenix.az.us
Fri, 13 Jun 2003 14:29:02 -0700


Here's a handy thing: just replace your .xinitrc with the following, and
then you can type "startx KDE" or "startx gnome" whichever you feel like
using.
--------------------------------------------
#!/bin/sh

########################################################################
# .xinitrc                                                             #
# 5/22/00 Stefan Jeglinski, jeglin@rapierbit.org                       #
# based on one written by hollis+@andrew.cmu.edu 1/5/99                #
# Thanks Hollis!                                                       #
#                                                                      #
# To use:                                                              #
# * if you have a ~/.Xclients, remove it. The system copy is in        #
#   /etc/X11/xinit/Xclients if you ever want it back.                  #
#                                                                      #
# * place this file in your home (~) directory. For root,              #
#   home is /root.                                                     #
#                                                                      #
# * Type 'startx after', 'startx kde', etc.                            #
#                                                                      #
########################################################################

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
xclients=$HOME/.Xclients
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f $userresources ]; then
    xrdb -merge $userresources
fi

if [ -f $usermodmap ]; then
    xmodmap $usermodmap
fi

########################################################################
#                                                                      #
# to fix backspace and delete in X if necessary;                       #
# these may need to be removed for XFree86 4.x                         #
#                                                                      #
########################################################################
xmodmap -e "keycode 59 = BackSpace"
xmodmap -e "keycode 125 = Delete"

########################################################################
#                                                                      #
# accelerate the mouse in the window manager;                          #
# Gnome and KDE typically override this                                #
#                                                                      #
########################################################################
xset m 8 3

########################################################################
#                                                                      #
# define mouse button usage in the window manager;                     #
# this directive may be "eaten" by the Gnome or KDE startup            #
#  and may therefore need to be run again after the environment        #
#  is started                                                          #
#                                                                      #
########################################################################
xmodmap -e "pointer = 2 1 3"

########################################################################
#                                                                      #
# * Set variables for different window managers and environments       #
#                                                                      #
# * $1 represents the first argument to startx.                        #
#                                                                      #
# * WM is the name of the program to execute. This is normally the     #
#   window manager itself, but in the case of kde  or gnome it needs   #
#   to be the gnome-session or startkde script.                        #
#                                                                      #
########################################################################

ARG=$1

# specify the default argument here:
DEFAULTWM="gnome-session"

if [ ! $ARG ]; then
 ARG=$DEFAULTWM
fi

########################################################################
#                                                                      #
# The difference between a desktop environment and a window manager    #
# is that an environment provides a desktop, while a window manager    #
# just handles the window dressing. An environment needs a WM, but     #
# not vice versa. The only 2 environments are Gnome and KDE. Common    #
# window managers for Gnome are Sawfish and Enlightenment. KDE         #
# has its own window manager (kwm).                                    #
#                                                                      #
########################################################################

# to add another wm/environment here, just copy, paste,
# and edit the 'elif' line:

if [ $ARG = "gnome" ]; then
 WM=gnome-session
elif [ $ARG = "kde" ]; then
 WM=startkde
elif [ $ARG = "after" ]; then
 WM=afterstep
elif [ $ARG = "wm" ]; then
 WM=wmaker
elif [ $ARG = "en" ]; then
 WM=enlightenment
elif [ $ARG = "bb" ]; then
 WM=blackbox
elif [ $ARG = "ice" ]; then
 WM=icewm
else
 WM=$DEFAULTWM
fi

########################################################################
#                                                                      #
# set a background window color for window managers only;              #
# if an environment starts up, it will override this                   #
#                                                                      #
########################################################################
xsetroot -solid MidnightBlue

########################################################################
#                                                                      #
# don't turn on screen-saver for window manager                        #
#                                                                      #
########################################################################
#xset s on

########################################################################
#                                                                      #
# turn on a REAL screensaver, http://www.jwz.org/xscreensaver/         #
#                                                                      #
########################################################################
xhost +localhost
xscreensaver &
xscreensaver-command -activate

########################################################################
#                                                                      #
#  The next line actually runs the selected window manager and logs    #
#  the output (stdout AND stderr) to the file ~/console. If you run a  #
#                                                                      #
#    tail -f ~/console                                                 #
#                                                                      #
#  in an xterm, it will display the (constantly updated) contents of   #
#  that file. This can be usful for talk requests, wm errors, etc.     #
#                                                                      #
########################################################################

exec $WM >& ~/console

--------------------------------------------

----- Original Message -----
From: Jeremy C. Reed <reed@reedmedia.net>
To: <plug-discuss@lists.plug.phoenix.az.us>
Sent: Friday, June 13, 2003 1:49 PM
Subject: Re: How To Replace GNOME with KDE


> On Fri, 13 Jun 2003, George Gambill wrote:
>
> > RedHat 8.0.  GNOME currently starts at "startx".  Looking at the
packages
> > installed (System Settings | Packages), I see that KDE was also
installed.
> >
> > Hot do I tell the system to bring up KDE at "startx" time?
>
> Red Hat comes with a tool called switchdesk. Have a look at its manual
> page.
>
> When using startx, startx starts xinit which can use your ~/.xinitrc file.
> That file can have "exec startkde" as another way to do it.
>
> (By the way, I think this was discuss on the list recently; have a look in
> the archives.)
>
>
>    Jeremy C. Reed
>    http://www.reedmedia.net/
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change  you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss