Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm using RedHat 7.2. I switched the desktop to TWM using the desktop switching tool. Now TWM won't start up and I don't know how to switch back to KDE or Gnome from the command prompt. Any suggestions?
check what ~/.xinitrc or ~/.Xclients say, and wehter they exist or not. that will define what WM you load if you've got them. the /etc... file is only a very last resort generaly
I think in RedHat I rely on Xclients. Is this correct?
Anyway, here are the contents of Xclients and xinitrc.
BTW, thanks for the help, guys.
Contents of Xclients:
#!/bin/bash
# Copyright 1999 - 2001 Red Hat, Inc.
# License: GNU General Public License v2
# check to see if the user has a preferred desktop
PREFERRED=
if [ -f /etc/sysconfig/desktop ]; then
if [ -n "`grep -i GNOME /etc/sysconfig/desktop`" ]; then
PREFERRED=gnome-session
elif [ -n "`grep -i KDE /etc/sysconfig/desktop`" ]; then
PREFERRED=startkde
fi
fi
if [ -n "$PREFERRED" ] && which $PREFERRED >/dev/null 2>&1; then
PREFERRED=`which $PREFERRED`
exec $PREFERRED
fi
# now if we can reach here, either no desktop file was present,
# or the desktop requested is not installed.
if [ -z "$PREFERRED" ]; then
GSESSION=gnome-session
STARTKDE=startkde
# by default, we run GNOME.
if which $GSESSION >/dev/null 2>&1; then
exec `which $GSESSION`
fi
# if GNOME isn't installed, try KDE.
if which $STARTKDE >/dev/null 2>&1; then
exec `which $STARTKDE`
fi
fi
# Failsafe.
# these files are left sitting around by TheNextLevel.
rm -f $HOME/Xrootenv.0
rm -f /tmp/fvwmrc* 2>/dev/null
# First thing - check the user preferences
if [ -f $HOME/.wm_style ] ; then
WMSTYLE=`cat $HOME/.wm_style |tr A-Z a-z`
case "$WMSTYLE" in
afterstep|windowmaker|mmaker)
exec /usr/X11R6/bin/RunWM --WindowMaker
;;
fvwm95|fvwm|fvwm2)
exec /usr/X11R6/bin/RunWM --Fvwm95
;;
mwm|lesstif)
exec /usr/X11R6/bin/RunWM --FvwmMWM
;;
esac
fi
# Argh! Nothing good is installed. Fall back to fvwm2 (win95-style) or twm
/usr/X11R6/bin/RunWM --Fvwm95 || {
# gosh, neither fvwm95 nor fvwm2 is available;
# fall back to failsafe settings
xclock -geometry 100x100-5+5 &
xterm -geometry 80x50-50+150 &
if [ -f /usr/bin/netscape -a -f /usr/share/doc/HTML/index.html ]; then
netscape /usr/share/doc/HTML/index.html &
fi
if [ -f /usr/X11R6/bin/fvwm ]; then
exec fvwm
else
exec twm
fi
}
Contents of xinitrc:
#!/bin/sh
# (c) 1999, 2000 Red Hat, Inc.
# Hack to symlink Glide3 lib to point to proper lib for either Voodoo 3 or 4/5
# This hack will go away in the future in XFree86 4.2.0 likely.
[ -x /usr/sbin/glidelink ] && /usr/sbin/glidelink
# merge in defaults
if [ -f "$sysresources" ]; then
xrdb -merge "$sysresources"
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
# merge in keymaps
if [ -f "$sysxkbmap" ]; then
setxkbmap `cat "$sysxkbmap"`
XKB_IN_USE=yes
fi
if [ -f "$userxkbmap" ]; then
setxkbmap `cat "$userxkbmap"`
XKB_IN_USE=yes
fi
if [ -z "$XKB_IN_USE" -a ! -L /etc/X11/X ]; then
if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f /etc/X11/XF86Config ]; then
xkbsymbols=`sed -n -e 's/^[ ]*XkbSymbols[ ]*"\(.*\)".*$/\1/p' /etc/X11/XF86Config`
if [ -n "$xkbsymbols" ]; then
setxkbmap -symbols "$xkbsymbols"
XKB_IN_USE=yes
fi
fi
fi
# xkb and xmodmap don't play nice together
if [ -z "$XKB_IN_USE" ]; then
if [ -f "$sysmodmap" ]; then
xmodmap "$sysmodmap"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
fi
unset XKB_IN_USE
# The user may have their own clients they want to run. If they don't,
# fall back to system defaults.
# run all system xinitrc shell scripts.
for i in /etc/X11/xinit/xinitrc.d/* ; do
if [ -x "$i" ]; then
. "$i"
fi
done
if [ -f $HOME/.Xclients ]; then
exec $HOME/.Xclients
elif [ -f /etc/X11/xinit/Xclients ]; then
exec /etc/X11/xinit/Xclients
else
# failsafe settings. Although we should never get here
# (we provide fallbacks in Xclients as well) it can't hurt.
xclock -geometry 100x100-5+5 &
xterm -geometry 80x50-50+150 &
if [ -x /usr/bin/netscape -a -f /usr/share/doc/HTML/index.html ]; then
netscape /usr/share/doc/HTML/index.html &
fi
if [ -x /usr/X11R6/bin/fvwm2 ]; then
exec fvwm2
else
exec twm
fi
fi
Sorry so late in getting back to this topic. Glad that you got it resolved. One other tip for you. The easiest way to have gotten your RH box back to K is:
$ /usr/bin/switchdesk kde
-- or for gnome --
$ /usr/bin/switchdesk gnome
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.