Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 6166 - /etc/X11/Sessions/Gnome does too many things, many redundant
Summary: /etc/X11/Sessions/Gnome does too many things, many redundant
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Spider (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-07 11:35 UTC by J. J. Ramsey
Modified: 2003-02-04 19:42 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description J. J. Ramsey 2002-08-07 11:35:32 UTC
/etc/X11/Sessions/Gnome has several items that are already done in
/etc/X11/xinit/xinitrc. For example, xinitrc already handles loading of X
resources and keyboard maps, so the lines 


userresources=$HOME/.Xresources 
usermodmap=$HOME/.Xmodmap 
userxkbmap=$HOME/.Xkbmap

sysresources=/etc/X11/Xresources 
sysmodmap=/etc/X11/Xmodmap 
sysxkbmap=/etc/X11/Xkbmap

rh6sysresources=/etc/X11/xinit/Xresources 
rh6sysmodmap=/etc/X11/xinit/Xmodmap 

# merge in defaults
if [ -f "$rh6sysresources" ]; then
    xrdb -merge "$rh6sysresources"
fi

if [ -f "$sysresources" ]; then
    xrdb -merge "$sysresources"
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

# merge in keymaps
if [ -f "$sysxkbmap" ]; then
    setxkbmap `cat "$sysxkbmap"`
    XKB_IN_USE=yes
fi

if [ -f "$userxkbmap" ]; then
    setxkbmap `cat "$userxkbmap"`
    XKB_IN_USE=yes
fi

#
# Eeek, this seems like too much magic here
#
if [ -z "$XKB_IN_USE" ] && [ ! -L /etc/X11/X ]; then
    if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f
/etc/X11/XF86Config ]; then
       xkbsymbols=`sed -n -e 's/^[     ]*XkbSymbols[   ]*"\(.*\)".*$/\1/p'
/etc/X11/XF86Config`
       if [ -n "$xkbsymbols" ]; then
           setxkbmap -symbols "$xkbsymbols"
           XKB_IN_USE=yes
       fi
    fi
fi

are unneeded. Some of the above stuff appears specific to Red Hat, such as
rh6sysresources, and shouldn't be there at all.

Other bits are unnecessary for other reasons, such as 

# run all system xinitrc shell scripts.
if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for i in /etc/X11/xinit/xinitrc.d/* ; do
        if [ -x "$i" ]; then
            . "$i"
        fi
    done
fi

If the above belongs in Gentoo at all, it belongs in /etc/X11/xinit/xinitrc, no
in something GNOME-specific. In fact, I've customized my /etc/X11/xinit/xinitrc
to include the "for" loop above, so those lines not only are unnecessary, but in
my case, actually get in the way by starting up my startup stuff twice. 

(BTW, one of the things I startup is the daemon xwrits, so doing the startup
twice would leave me with one extra instance of xwrits running in the
background. Moral of the story: don't assume rerunning the startup does no harm.)

I suggest keeping /etc/X11/Sessions/Gnome simple. It needs only three lines:

#!/bin/bash
export GDK_USE_XFT=1
exec gnome-session

The rest of the startup can be, and should be, put in non-GNOME-specific files.
Comment 1 Spider (RETIRED) gentoo-dev 2002-08-07 18:59:40 UTC
azarah, your comments on this please?

We should make the gnome script source ~/.gnomerc so the user can specify
WINDOW_MANAGER and other things there...
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2002-08-07 23:43:26 UTC
Sure.  This is the default on that comes with GDM, and that most, if not
all the other distro's distribute.  And why is it unneeded ?  The scripts
of XDM does pretty much the same thing.

Comment 3 Spider (RETIRED) gentoo-dev 2002-08-26 15:17:55 UTC
closing this since it doesn't seem to go anywhere. 

reopen and reassign if you want it.