CLI Home
Archive

Fedora Core 4 Desktop
Gnome 2.10 and KDE 3.4

Bill Moss
May 29, 2005

Content

Gnome 2.10
File Selector
File Manager
Mime Type Editing
Icon Association
Menu Editing
File Association
Login Screen
Splash Screen
X Backbround Color
KDE 3.4
File Selector
File Manager
Mime Type Editing
Icon Association
Menu Editing
File Association
Login Screen
Splash Screen
X Backbround Color

Introduction

In April of 2004 I wrote an article on the installation of FC1 on a Dell C600 in which I compared Gnome 2.4 and KDE 3.1. At that time I felt that Gnome was behind KDE in six important areas:

  file selector
  file manager
  mime type editing
  icon association
  file association
  menu editing

with the file selector being the showstopper. This is no longer the case. It appears that both Gnome and KDE are in the process of adopting FreeDesktop.org standards. There is still a long way to go.

Gnome 2.10

File Selector. The GTK file selector used in all Gnome 2.10 applications and also in Firefox 1.04 has leveled the playing field. Bookmarks created for use with the file selector also show up in the new Gnome 'Places' panel menu.

File Manager. The file manager Nautilus 2.10 can be used in browser mode, making its behavior similar to Konqueror, or it can be used in non-browser mode which does not have a toolbar with back button and so forth. Bookmarks accelerate navigation in browser mode, while the 'Places' menu assists navigation in non-browser mode.

Nautilus can mount remote WebDAV directories. Here are locations for two Blackboard Content System directories

  davs://bb.clemson.edu/bbcswebdav/users/bmoss
  davs://bb.clemson.edu/bbcswebdav/courses/bmoss-mthsc-206

Nautilus can mount remote Native File System shares. Here is the location for the Share server at Clemson.

  smb://share.clemson.edu/share

Mime Type Editing. Gnome 2.10 still does not have a mime type editor but it is fairly easy to make a system wide addition to the mime type database. Gnome 2.10 has adopted the FreeDesktop.org approach to setting mime types. To illustrate, I'll use the mathematics application Maple which I installed in

  /usr/local/maple9.5

To add a mime type for Maple, as root I edited the XML file

  /usr/share/mime/packages/freedesktop.org.xml

by adding the lines

  <mime-type type="application/maple">
    <comment xml:lang="en">Maple Worksheet</comment>
    <glob pattern="*.mws"/>
  </mime-type>

and then I executed the command

  update-mime-database /usr/share/mime

Icon Association. Gnome 2.10 still does not have an editor that can make a system wide addition to the icons associated with different mime types. Again, this is fairly easy to do my hand. To add an icon for Maple worksheets, as root I did

  cp /usr/local/maple9.5/cmaple.png /usr/share/icons/
      gnome/48x48/mimetypes/
      gnome-mime-application-maple.png

  chmod 644 /usr/share/icons/gnome/48x48/mimetypes/
      gnome-mime-application-maple.png

  gtk-update-icon-cache /usr/share/icons/gnome

Menu Editing. Gnome 2.10 does not yet have a menu editor but because the FreeDesktop.org approach to menus is now being used by Gnome and KDE, menus are easily edited by hand. Gnome and KDE desktop menus are controlled by three types of files

  Menu files (*.menu)

  System: /etc/xdg/menus
  User: ~/.config/menus 
  Directory files (*.directory)
  
  System: /usr/share/desktop-directories
  User: ~/.gnome/share/desktop-directories (Gnome)
  User: ~/.local/share/desktop-directories (KDE)
  Desktop files (*.desktop)

  System: /usr/share/applications (Gnome and KDE)
  System: /usr/share/applications/kde (KDE)
  System: /usr/share/applnk (KDE)
  System: /etc/X11/applnk (Gnome and KDE)
  User: ~/.gnome/share/applications (Gnome)
  User: ~/.local/share/applications (KDE

To add a menu item we must first create a desktop file. To add a menu item for Maple to the Programming submenu, as root I created a maple.desktop file containing the following lines and then modified its permissions.

  /usr/share/applications/maple.desktop

  [Desktop Entry]
  Exec=xmaple -cw
  Icon=/usr/local/maple9.5/cmaple.png
  MimeType=application/maple
  Name=Maple Classic
  StartupNotify=true
  Terminal=false
  Type=Application
  Categories=Development

  chmod 644 /usr/share/applications/maple.desktop

Note that this desktop file contains a Categories key which, in general, will have a semicolon separated list as its value. In this case, Maple has been put in the Development category.

Examining the menu file

  /etc/xdg/menus/applications.menu

we find the XML segment

  <!-- Development Tools -->
  <Menu>
    <Name>Development</Name>
    <Directory>Development.directory</Directory>
    <Include>
      <And>
        <Category>Development</Category>
        <Not>
          <Category>KDE</Category>
        </Not>
      </And>
    </Include>
  </Menu> <!-- End Development Tools -->

Maple is in the Development category but it shows up in the Programming menu. What gives? This is where the directory files come into play. We find

  /usr/share/desktop-directories/Development.directory

  [Desktop Entry]
  Name=Programming
  ...
  Icon=redhat-programming.png
  Type=Directory

This directory file converts the Development category into the Programming submenu item. Note that the icon referred to here is in /usr/share/pixmaps. Also, note that I added the 'not category KDE code' to the menu file to keep KDE applications from displaying in the Gnome Programming submenu. This works because KDE applications generally have KDE in their Categories list. As an alternative, the line

  OnlyShowIn=KDE

inserted in a desktop file will insure that the corresponding application menu item only shows up in a KDE submenu and not in a Gnome submenu.

Next, I added a submenu to the applications menu by adding the following XML code to the applications.menu file.

  /etc/xdg/menus/applications.menu

  <!-- Viewers -->
  <Menu>
    <Name>Viewers</Name>
    <Directory>Viewers.directory</Directory>
    <Include>
      <And>
        <Category>Viewers</Category>
        <Not>
          <Category>KDE</Category>
        </Not>
      </And>
    </Include>
  </Menu> <!-- End Viewers -->

I edited the Categories line in the files

  AdobeReader.desktop
  gnome-ggv.desktop
  net-xpdf.desktop
  gnome-gpdf.desktop

  Categories=Viewers

so that these applications would show up in the Viewers submenu. To commit these menu changes, as root issue the command

  update-desktop-database -v

File Association. At the top of the context menu for a file in Nautilus is found the 'Open with "Preferred Application" menu item. Next, is found the 'Open with' menu item, which lists all other applications which can open the file. These menu items are controlled respectively by the following files:

  /usr/share/applications/defaults.list
  /usr/share/applications/mimeinfo.cache

Each line in defaults.list contains a desktop file followed by a mimetype. For example, the line

  application/postscript=evince.desktop

shows that Evince is the preferred application for opening postscript files. Each line in mimeinfo.cache contains a desktop file followed by a list of mimetypes. For example, the line

  image/gif=gthumb.desktop;gimp-2.2.desktop;
      gnome-eog.desktop;

shows the list of applications available for opening gif files. Gnome constructs the mimeinfo.cache file by processing the mimetypes recorded in the desktop files. Gnome comes with a pre-built system-wide defaults.list. At the user level there are parallel files

  ~/.local/applications/defaults.list
  ~/.local/applications/mimeinfo.cache

Users can add lines to these files as follows.

  In a Nautilus window, right click on a file
  Select Properties
  Select the 'Open With' tab
  To add to the current 'Open With' list
  Hit Add and select an application
  Hit Add again
  Select the preferred application radio button
  

Login Screen. Gnome 2.10 login themes are displayed by the Gnome desktop manager GDM and are stored in

  /usr/share/gdm/themes

Additional GDM themes can be download from

  http://art.gnome.org/

GDM themes can be chosen using the Gnome 2.10 Desktop menu

  Desktop -> System Settings -> Login Manager
     -> Graphical greeter

Splash Screen. Gnome 2.10 splash screen graphics files are stored in

  /usr/share/pixmaps/splash

Additional splash screens can be download from

  http://art.gnome.org/

Splash screens are set using the GConf 'Configuration Editor' and the path

  apps/gnome-session/options/
      splash_image splash/gnome-splash-context.png

X Background Color. The X server uses the background color set in

  /etc/X11/xinit/xinitrc-common

  [ -x /usr/X11R6/bin/xsetroot ] && 
      /usr/X11R6/bin/xsetroot -solid '#5A7AB7'

The default color is '#222E45' which blue-black. I have set a lighter blue color here. The X background color is seen before the Login screen, behind the splash screen, and at logout.

KDE 3.4

By default FC4 loads the Gnome desktop. The command switchdesk kde can be used to change the default desktop and the login screen.

File Selector. All KDE 3.4 applications use a common file selector that provides bookmarks for quick navigation around the file system.

File Manager. The file manager Konqueror 3.4 uses bookmarks to facilitate easy navigation. Profiles can be used to alter the look and feel. The provided profiles include a web browsing profile, a file management profile, and a split screen profile which is useful for copy files from one directory to another.

Konqueror can mount remote WebDAV directories. Here are locations for two Blackboard Content System directories.

  webdav://bb.clemson.edu/bbcswebdav/users/bmoss
  webdav://bb.clemson.edu/bbcswebdav/courses/bmoss-mthsc-206

Nautilus can mount remote Native File System shares. Here is the location for the Share server at Clemson.

  smb://share.clemson.edu/share

Mime Type Editing. See File Association.

Icon Association. See File Association.

Menu Editing. System level menu editing can be done by hand as shown above for Gnome by adding, editing, or removing *.desktop files and by editing the file

  /etc/xdg/menus/kde-applications.menu

Submenus can be added, removed, or their Categories edited.

User level menu editing can be done using the K menu editor. Submenus can be added or removed and submenu items can be added or removed. On a single user system, this is the easiest way to edit the menus.

  Right click panel
  Select Configure Panel
  Selec Menus tab
  Hit the K menu edit button

User level menu files are stored in

  ~/.local/share/applications
  ~/.local/share/desktop-directories

File Association. Mime typing and file and icon association in KDE 3.4 can be done at the user level using the File Association Utility.

  Applications Menu
  Control Center
  KDE Components
  File Associations

KDE 3.4 stores mimetype *.desktop files in the following locations.

  System: /usr/share/mimelnk
  User: ~/.kde/share/mimelnk

These files also contain icon associations. Here is an example file

  ~/.kde/share/mimelnk/applications/matlab.desktop

  [Desktop Entry]
  Comment=MATLAB M file
  Hidden=false
  Icon=/usr/local/matlab/matlab.png
  MimeType=application/matlab
  Patterns=*.m
  Type=MimeType

Login Screen. KDE 3.4 login themes are displayed by the KDE login manager KDM and are stored in

  /usr/share/apps/kdm/themes

The KDE 3.4 Control Center is not up to date. It is best to manually set the KDM theme in

  /etc/kde/kdm/kdmrc

  [X-*-Greeter]
  ...
  Theme=/usr/share/apps/kdm/themes/Slx
  UseTheme=true

Additional KDM themes can be downloaded from

  http://www.kde-look.org

Splash Screen. KDE 3.4 splash screens are stored as themes in

  /usr/share/apps/ksplash/Themes

The default splash theme is named Default. The KDE 3.4 Control Center is not set up to change the splash theme. The splash theme can be set in

  System: /usr/share/config/ksplashrc
  User: ~/.kde/share/config/ksplashrc

Additional KDM splash screens can be downloaded from

  http://www.kde-look.org

X Background Color. The X server uses the background color set in

  /etc/X11/xinit/xinitrc-common

  [ -x /usr/X11R6/bin/xsetroot ] && 
      /usr/X11R6/bin/xsetroot -solid '#5A7AB7'

The default color is '#222E45' which blue-black. I have set a lighter blue color here. The X background color is seen before the Login screen, behind the splash screen, and at logout.