justlinux.com
Mon, 23-Nov-2009 09:48:45 GMT
internet.com
Forum: Registered Users: 73495, Online: 165
nhfs Here you can view your subscribed threads, work with private messages and edit your profile and preferences Registration is free! Calendar Find other members Frequently Asked Questions Search Home Home

Help File Library: Changing the Default Desktop


Written By: Qwijibrumm

Foreword

Many people seem to have problems trying to switch between GNOME and KDE as their default when starting the X window system. The problem is not that it is difficult at all, rather many people just don't know where to start. There are about as many little utilities to change this as there are distributions. However, it is my opinion that most of these system tools will never help a user learn. That's why I will focus here on doing it manually. This also insures that this Help File will be applicable to almost all distributions.

This document aims to provide a little insight, and background as to what is actually happening when you type startx. After knowing what is going on, troubleshooting any problems that arise is a lot easier.

Principles of the startx Script

To change the default desktop when you startx, you will need to edit one of two files. The first is /etc/X11/xinit/xinitrc.

This script is used as a global fallback preference when there is no /home/username/.xinitrc file present (or /root/.xinitrc for root user). This file must be altered if present. This will change the individual user's preference.

You see, one thing startx does is looks for the presence of /home/somebody/.xinitrc and runs that. If that file does not exist, it will run /etc/X11/xinit/xinitrc It's a little more complicated than that, but we won't get into that here.

Application

So let's say that everyone in your house loves KDE but you. You love GNOME. You would create a /home/yourname/.xinitrc script that tells the system to load GNOME. You would set the global /etc/X11/xinit/xinitrc to start up KDE. Everyone else who logs in and types startx will get KDE, as they have no file named /home/them/.xinitrc

The startx script notes the absense of this file and defaults to the global script. But when you log in and startx, you get GNOME, since startx notes that you do have a file /home/joeschmoe/.xinitrc The system is then told to run that script.

So, what do you have to change in this goofy xinitrc script to change the preferences? Just one line.

At the very end of the script the line should read

exec gnome-session"

or

startkde

as applicable.

Swapping the command between the two will set up what desktop environment will be your default.

You can also try changing this for the global script and then setting one user up with a different environment.

The global xinitrc and the user .xinitrc scripts are interchangeable so you can just copy the global to your home directory, rename it as .xinitrc, change the appropriate line, and you have your own personal desktop preference. Troubleshooting Always keep these scripts in mind when troubleshooting a problem where X just won't even try to load. The problem could be that you have an empty .xinitrc script in your home directory. Or if one user can startx and no one else can, check if the one who does has a personal .xinitrc and check if the others don't. Then check if your global xinitrc file got removed. Keeping all this in mind can really help a whole lot of problems.


internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers
internet.commerce
Be a Commerce Partner











internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs