Operating System - Linux
1819695 Members
3824 Online
109605 Solutions
New Discussion юеВ

Starting KDE or GNOME using startx

 
SOLVED
Go to solution
NavalurIT
New Member

Starting KDE or GNOME using startx

while using startx command, how to give option to launch either GNOME or KDE as needed. By default startx launches GNOME and if I modify a file Desktop, I can launch KDE. In either case only one of the two ie. either GNOME or KDE can be launched but not as preferred. Say, first time i like to launch GNOME and at the next login I may wish to launch KDE. I dont want to go and change Desktop file each and everytime. Please give an option to launch KDE or GNOME as I wish using startx.
6 REPLIES 6
Stuart Browne
Honored Contributor

Re: Starting KDE or GNOME using startx

I'm unaware of any software which allows you to do this that is distributed with most of the major distributions.

I'm sure there are plenty of little applications which would allow you to do this. You might want to search for a 'desktop switching' program in Google, or on sourceforge.net.

Currently, this sort of service is availble if you are using either the Gnome (or KDE I beleive) login servers (gdm for Gnome).

However this means that there's always an X session open, just not necessarily logged in.
One long-haired git at your service...
I_M
Honored Contributor
Solution

Re: Starting KDE or GNOME using startx

Hi

On RedHat, you may use switchdesk before startx to select which X Window Environment you want to use.

But this is not "while using startx command".

So you write a small shell script to (1) select X Window Env, then
(2) start X Window.

Good luck
C.W.Holeman II
New Member

Re: Starting KDE or GNOME using startx

From http://www.rapierbit.org/linux/winmgrs.html

the key is .xinitrc

#!/bin/sh
...
if [ $ARG = "gnome" ]; then
WM=gnome-session
elif [ $ARG = "kde" ]; then
WM=startkde
fi

With this .xinitrc, from bash, just run startx gnome, startx kde.

Paddy_1
Valued Contributor

Re: Starting KDE or GNOME using startx

alternatively you can use either of these commands
(a)gdm to start GNOME Desktop
(b)kdm to start KDE Desktop
The m stands for manager i guess
The sufficiency of my merit is to know that my merit is NOT sufficient
Matthew Couper
Frequent Advisor

Re: Starting KDE or GNOME using startx

Go with Paddy,
instead of using startx to start the GUI, use which window manager you wish. gdm starts Gnome and kdm starts KDE, both of these will invoke the startx command.
Satish Kumar_2
New Member

Re: Starting KDE or GNOME using startx

I think gdm and kde works only when logged in as root. when i tried these commands from other login it gives an error like only root can invoke this command. any comments.

I think using the argument option in .xintrc is a good solution.