LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Want an X server Running but Not a Desktop (http://www.linuxquestions.org/questions/linux-general-1/want-an-x-server-running-but-not-a-desktop-161337/)

aggiefl 03-23-2004 10:14 AM

Want an X server Running but Not a Desktop
 
I am running RedHat 9, with Ximian desktop. I have a multi-monitor setup and am trying to run a GTK program I built for Meteorological Displays on each monitor. I want to run in level 3 (multiuser mode) with and x server running but I do not want to load a desktop. When I telinit 3 I can't run my program because there is no X server running, so I "startx", and it automatically loads the desktop. I've hunted through various files and can't quite determine where to prevent the desktop from loading when I run startx, at least I am hesitant to start commenting out stuff that I don't fully understand.

To sum up I want init level 3, X server, but no desktop, eventually I will add the "startx" to a boot time script that starts X with level 3, but again I do not want the desktop to load, how can I accomplish this?

Thanks

ilikejam 03-23-2004 11:47 AM

Hi.

Try running 'xinit' instead of 'startx'.

Dave

bnice 03-23-2004 11:53 AM

Quote:

To sum up I want init level 3, X server, but no desktop, eventually I will add the "startx" to a boot time script that starts X with level 3, but again I do not want the desktop to load, how can I accomplish this?
To start in runlevel 3 edit /etc/inittab, the first uncommented line should look like this. Yours probably has a 4 in it now:

Code:

# Default runlevel. (Do not set to 0 or 6)
id:3:initdefault:

To start X with no WD/Desktop, find your xinitrc file- usually /etc/X11/xinit/xinitrc- the last line starts your WM/Desktop. Comment it out and call the program you want to run instaed.

Check for a hidden file in your home directory called .xinitrc (do ls -a) if it's there, it will override /etc/X11/xinit/xinitrc so make your changes there.

aggiefl 03-23-2004 12:50 PM

bnice,

Sorry, but which line in the xinitrc file do I comment out? Here's the file:

I have no .xinitrc so it's grabbing the system xinitrc, this calls Xclients that loads the desktop? The last elif statement in the below file right? I don't know this scripting language stuff but I can kind of gather what it's doing.

#!/bin/sh
# (c) 1999-2002 Red Hat, Inc.

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
userxkbmap=$HOME/.Xkbmap

sysresources=/etc/X11/Xresources
sysmodmap=/etc/X11/Xmodmap
sysxkbmap=/etc/X11/Xkbmap

# 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

# run all system xinitrc shell scripts.
for i in /etc/X11/xinit/xinitrc.d/* ; do
if [ -x "$i" ]; then
. "$i"
fi
done

# The user may have their own clients they want to run. If they don't,
# fall back to system defaults.
# set up ssh agent environment if available.

if [ -f $HOME/.Xclients ]; then
[ -x /usr/bin/ssh-agent -a -z "$SSH_AGENT_PID" ] && \
exec ssh-agent $HOME/.Xclients || \
exec $HOME/.Xclients
elif [ -f /etc/X11/xinit/Xclients ]; then
[ -x /usr/bin/ssh-agent -a -z "$SSH_AGENT_PID" ] && \
exec ssh-agent /etc/X11/xinit/Xclients || \
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


All times are GMT -5. The time now is 08:06 PM.