How to change Desktop Mgr when machine set to runlevel 3

With the default boot set to runlevel 5 you have a login screen that provides a menu to choose which desktop to run (KDE, Gnome, etc).

My machine is set to boot to runlevel 3. How can I switch the desktop from the command line before starting X?

Fedora has a nice little utility called switchdesk, but can’t find anything like it for openSUSE 11.2.

Thanks

The desktop type seems to be saved in a file called .dmrc in $HOME.

There’s a little discussion about it here, but it’s Ubuntu-centric:

How to change the default Xsession? - Ubuntu Forums

Mine only contains:

[Desktop]
Session=default

so I have not tried switching to other desktops.

Ok so what file determines what the default desktop mgr is?

Since I’m using openSUSE 11.2 I will shy away from the Ubuntu thread and hope someone could provide a Suse specific answer.

Thanks

Probably /etc/sysconfig/windowmanager. You’re not meant to edit that unless you want to change it for everybody on the machine. $HOME/.dmrc is apparently the place for per user changes. Why not try putting kde4 instead of default in there and see what happens. You can always edit it back.

$yast sysconfig

If you use startx you can set the WINDOWMANAGER variable in your ~/.profile (actually it should be WINDOW_MANAGER, but openSUSE seems to evaluate WINDOWMANAGER instead. Have a look in /etc/X11/xinit/xinitrc.common)

Strange, Gnome is not even in the list here but I know it’s installed:


test -n "$WINDOWMANAGER" && WINDOWMANAGER="$(type -p $WINDOWMANAGER 2>/dev/null)"
if test -z "$WINDOWMANAGER" ; then
    if test -x /usr/X11R6/bin/kde -o -x /usr/bin/kde; then
        WINDOWMANAGER=$(type -p kde)
    elif test -x /usr/X11R6/bin/startkde -o -x /usr/bin/startkde; then
        WINDOWMANAGER=$(type -p startkde)
    elif test -x /usr/X11R6/bin/fvwm2 -o -x /usr/bin/fvwm2; then
        WINDOWMANAGER=$(type -p fvwm2)
    elif test -x /usr/X11R6/bin/wmlist -o -x /usr/bin/wmlist ; then
        for i in $($(type -p wmlist)) ; do
            WINDOWMANAGER="$(type -p $i 2>/dev/null)"
            test -n "$WINDOWMANAGER" && break
        done
    fi
fi

Editing the .dmrc file had no effect.
.profile had no entry for anything related to window mgr or desktop mgr.

So is this a bug perhaps? I double checked and Gnome is installed. I chose to install it when I installed the OS.

No idea. But maybe you could switch the desktop in level 5 and see which file gets changed. Surely the previous desktop must be recorded somewhere. Rather brute force way to find out but needs must.

On Fri, 22 Jan 2010 18:26:01 GMT, linuxdave <linuxdave@no-mx.forums.opensuse.org> wrote:

>
>So is this a bug perhaps? I double checked and Gnome is installed. I
>chose to install it when I installed the OS.

IIRC windowmanager describes the graphical login interface, not the
after login desktop environment.

As best I can tell, there is no way to change your desktop mgr from the command line in openSUSE 11.2

I did change inittab to runlevel 5 and also tried changing the values in the .dmrc file to no avail. Also searched Google and the web for any other references and found a similar post on the subject here from 2005. There was no clear answer in that post either.

Bummer. >:(

Maybe they’ll put a util in the next release for that… Something like Fedora’s switchdesk perhaps???

Use yast from command line:
yast>system>/etc/sysconfig editor>Desktop>Window manager>DEFAULT_WM

I may give that a try. I had set inittab to level 5 and changed desktop to Gnome then logged in and Gnome loaded. Then changed inittab back to level 3, rebooted. logged in and started X and KDE loaded anyway. To me, that is a BUG (or just an oversight on the developers part).

Still, a nice little switchdesk utility would be ideal for 11.3 maybe (or whatever version # they decide to give the next release).

add to your Grub starting line: init 5

By the way the only tool you need to configure your default runlevel is a text editor. Log as root and edit /etc/inittab, search for this line:

# The default runlevel is defined here
id:5:initdefault:

after “id” you have the default runlevel, which should be 3 in your case, edit to 5 and restart.

No need to lame GUI tools :slight_smile:

I use vi to edit inittab. I don’t think you read through this thread very well as changing the run level is not the question/problem at hand… rotfl!