Get Your Default KDE and GNOME Desktops in Line

by David D. Scribner

As mentioned in my last article, Get Your Default KDE and GNOME Menus in Line, the User Manuals for the KDE and GNOME GUI environments include instructions on modifying the user’s menus and desktop properties. Just as with the menus however, modifications to the desktop settings made by individual users are stored in the user’s home directory and have no affect on the “defaults” installed for new users.

Being the system administrator, you may have custom desktop wallpaper, shortcut icons and panel (or Kicker, as KDE now calls it) icons that differ from those set up in the default configurations. If you wish to have the default desktops installed for new users tailored to include selected application icons in the panel or kicker (taskbar), or changes to the default desktop shortcuts, background, colors or style that GNOME and KDE normally set up for those new users, you will have to make a few modifications.

This article is intended to cover the basic tasks of customizing such default installations. Since customizing the default desktops for your new users result in changes to the installed files, back up any of these files/directories before proceeding with any modifications!

Desktop Configuration Skeletons

Items pertaining to the desktop you want your new users to be greeted with are perhaps easiest to configure by placing the relevant KDE and GNOME desktop configuration files in the /etc/skel directory. You could modify the master files KDE and GNOME use to create new user setups, but they may be overwritten should you upgrade to a newer version of the environment. To keep your administration tasks simple, utilize the convenience /etc/skel offers.

The /etc/skel directory holds the files and directories that will be copied over to a new user’s home directory when created by the system. Your administration needs might warrant keeping more than one configuration on hand, in which case variations could be stored elsewhere and copied over to the user’s home directory manually or with a script as needed.

Not all settings, files and directories created by KDE and GNOME during a fresh setup for new users need to be included in the /etc/skel directory, as when a new user starts GNOME or KDE for the first time, the remaining files needed by the environment will be created. Fortunately, the files previously copied over from /etc/skel during the user account creation won’t be overwritten, allowing you to tweak and customize many of those “default” settings to your particular needs.

The environment’s desktop configuration information in a stock Red Hat 7.1 installation with GNOME 1.4 and KDE 2.1 for example, are usually found in the user’s home directory, and in the following subdirectories:

KDE Personal Directories

~/.kde

~/.kde/Autostart

~/Desktop

GNOME Personal Directories

~/.gnome

~/.gnome-desktop

~/.sawfish

~/.netscape	(if Netscape Navigator is chosen as the default browser)

To create a desktop skeleton to work with, first create a dummy user account, then login as that user and configure your base using the GNOME or KDE Control Center. Once this has been done, the necessary directories and files created can be copied over to /etc/skel, ownership changed to root and permissions set to 0644. If you have to experiment and fiddle with various desktop settings before coming up with a suitable “default” of your own, make a note of those settings and apply them to a newly created account to keep your skeleton trim. Don’t forget to delete any dummy user accounts created when you’re done.

In the following sections I’ll cover a few of the desktop items you might wish to customize and include as part of your skeleton arrangement.

Desktop “Shortcuts”

Because of its visual prominence, the desktop is great area for icon-links (shortcuts) introducing general help, reference material and policies a company has available for new users. Even though many of these shortcuts should also be included in your menu tree, placement on the desktop helps make them “hard to miss” for new users.

For example, many companies have employee manuals, forms or other documents that new users should have available to them when starting a new position. If your company had the foresight to make them available them online, they are prime candidates for desktop shortcuts. You may also want to place shortcuts according to department or group if you have specific applications they use regularly, leaving the links in the panel for common applications used by all.

Although both KDE and GNOME include a default set of desktop icons linked to various documents, URLs, applications and devices, you may wish to modify or create additional links in these directories for items you want to appear on the user’s desktop when the chosen environment is started for the first time. KDE keeps these desktop shortcuts in ~/Desktop, and GNOME keeps them in ~/.gnome-desktop.

KDE Desktop Settings

Various KDE desktop configuration information is kept in “*rc” (run commands, or resource) files located in the ~/.kde/share/config directory. Other configuration files can also be found in the subdirectories of ~/.kde/share/apps. In the previous article on customizing your system’s default menus, I mentioned many of the *.desktop and .directory files found on a system with stock KDE and GNOME environments include variables for multiple languages. You may also find multi-language variables listed in some of the *rc files listed below. If you’re pinching resources and trimming fat, you might take a look at these, too, and delete any unnecessary lines.

Kicker panel button information is kept in the ~/.kde/share/config/kickerrc file. This is where you can specify which Applets and shortcut icons will appear in the new user’s kicker panel, as well as icon placement ordering within the panel.

The ~/.kde/share/config/kdeglobals file contains information on window colors, fonts, anti-aliasing, toolbar styling, current theme and window manager settings. As this file determines a lot on how the desktop is to be presented, this is one you’ll surely want to include as part of your skeleton setup.

Window Style directives on which particular style to use, KDE-SGI or KDE Step for example, is kept in ~/.kde/share/config/kstylerc.

Desktop Background properties such as color settings or wallpaper image filenames are kept in the ~/.kde/share/config/kdesktoprc file. If a wallpaper image is specified as part of a chosen theme, the image file is copied into the ~/.kde/share/wallpapers directory. If you have a user that likes to change their themes every other day, and those themes include wallpaper images (as many do), they’ll fill their quota quick! The preferred font to use for text on the desktop (icon labels for example) is also specified in the kdesktoprc file.

Files that make up the current theme are kept in the directory ~./kde/share/apps/kthememgr/Work/<themename> (for the layout). For example, the theme layout for the Grex theme would be kept in ~/.kde/share/apps/kthememgr/Work/Grex. The pixmaps used by the theme are kept in the ~/.kde/share/apps/kwin/pics directory.

Konqueror information, as both a file manager and a browser, can be found in the ~/.kde/share/config/konquerorrc file. Here is where you can set default view, terminal and editor settings as well as those for HTML, Java and JavaScript. The default font to use with the file manager is also listed in this file.

The default bookmark file for the Konqueror browser is stored in the ~/.kde/share/apps/konqueror directory as bookmarks.xml.

Settings for the konsole terminal application include information as to which shell to use (such as bash), window size, schema, font, whether to display or hide the Menubar, etc. can be found in ~/.kde/share/config/konsolerc.

Application or script directives can also be placed as files in the ~/.kde/Autostart directory. Although usually in the form of <selection>.desktop files, content and naming may vary. This enables you to start a process or application automatically as part of the standard KDE post-initialization process, and is very useful for invoking system monitors and log windows for administrators, database front-ends, or other applications that are regularly invoked at environment startup.

GNOME Desktop Settings

Various GNOME desktop configuration information is kept in the ~/.gnome and ~./gnome-desktop directories. Since GNOME also uses Sawfish as its default window manager, other configuration files can also be found in the ~/.sawfish subdirectory.

General GNOME Panel information is kept in ~/.gnome/panel. This information controls the color, size and placement of the Panel Bar, and includes settings as to whether Tool Tips is enabled, menus are merged, etc. Although they have identical names, this is NOT the same panel file as is located in the ~/.gnome/panel.d/default directory, so don’t confuse (or overwrite) the two. The panel file kept in ~/.gnome/panel.d/default, however, does specify some settings such as panel button size, background color or pixmaps, so you might take a look at this one, too, if your configuration warrants it.

Information as to which Applets or application icon shortcuts are included in the GNOME Panel is kept in the ~/.gnome/panel.d/default/Applet_Config file. The Applet information is kept in the Applet_x_Extern files (where "x" is a number 3 or higher), as Applet_1 is the Main Menu and Applet_2 is the Lock, the two default GNOME Panel objects. Application shortcut information is kept in Applet_x.desktop files (again, where “x” is a number).

GNOME Desktop Background information is kept in the ~/.gnome/Background file, and is where you can specify a particular background color scheme including gradients, or a wallpaper image’s filename (including path).

GNOME Desktop Theme information is kept in ~/.gnome/theme-switcher-capplet file, along with the chosen font to use with the theme.

The default window manager of choice for GNOME is specified in the ~/.gnome/default.wm file. For example, if Sawfish is your chosen window manager, this is where it will be listed. Other window manager configuration files, however, will be stored elsewhere.

The Sawfish Window Manager (under GNOME) keeps window properties such as frame-theme, frame colors, focus behaviors, etc. in the ~/.sawfish/custom file.

Netscape Navigator is usually installed as the default GNOME browser in many distributions. The bookmark file for Netscape is usually ~/.netscape/bookmarks.html. If this suites your setup and you have custom bookmarks you would like to start out your new users with, you may want to include this file in your skeleton.

There may be other applications or window managers that you will want to use in combination with the KDE and GNOME desktop environments. Although they are outside the scope of this article, configuration is usually similar in that the user directories for that package are usually hidden, and reside in the user’s home directory. Once configured and the files located, the directories and the necessary files they contain can be copied over to your skeleton layout in /etc/skel. More information on the syntax and layout of *.desktop files for developers can be found at freedesktop.org’s Desktop Entry Standard web page.

Hopefully this article has helped you get your default KDE and GNOME desktops in line for your new user setups. When combined with a custom-structured menu system tailored to your company’s needs, you’re well on your way in presenting a professional Linux GUI environment to welcome your new users!

Copyright © 2002 David D. Scribner. All rights reserved.

SysAdmin: Get Your KDE and GNOME Desktops in Line

An article targeted to sysadmins needing to configure default KDE and GNOME desktops for new users - a soft touch in bringing Linux to the desktop.

David D. Scribner

2001-12-22T13:21:00

David Scribner