e61737
# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This
e61737
# copyrighted material is made available to anyone wishing to use, modify,
e61737
# copy, or redistribute it subject to the terms and conditions of the
e61737
# GNU General Public License version 2.
e61737
#
e61737
# You should have received a copy of the GNU General Public License
e61737
# along with this program; if not, write to the Free Software
e61737
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
e61737
e61737
# xinitrc-common
e61737
#
e61737
# This is common code shared by both Xsession and xinitrc scripts.  Be sure
e61737
# to take this into account when fixing bugs or adding new functionality.
e61737
e61737
# Set up i18n environment
e61737
if [ -r /etc/profile.d/lang.sh ]; then
e61737
  . /etc/profile.d/lang.sh
e61737
fi
e61737
e61737
[ -r $HOME/.profile ] && . $HOME/.profile
e61737
e61737
userresources=$HOME/.Xresources
e61737
usermodmap=$HOME/.Xmodmap
e61737
userxkbmap=$HOME/.Xkbmap
e61737
e61737
sysresources=/etc/X11/Xresources
e61737
sysmodmap=/etc/X11/Xmodmap
e61737
sysxkbmap=/etc/X11/Xkbmap
e61737
e61737
# merge in defaults
e61737
[ -r "$sysresources" ] && xrdb -nocpp -merge "$sysresources"
e61737
[ -r "$userresources" ] && xrdb -merge "$userresources"
e61737
e61737
# merge in keymaps
e61737
if [ -r "$sysxkbmap" ]; then
e61737
    setxkbmap $(cat "$sysxkbmap")
e61737
fi
e61737
e61737
if [ -r "$userxkbmap" ]; then
e61737
    setxkbmap $(cat "$userxkbmap")
e61737
fi
e61737
e61737
# xkb and xmodmap don't play nice together
e61737
if ! [ -r "$sysxkbmap" -o -r "$userxkbmap" ] ; then
e61737
    [ -r "$sysmodmap" ] && xmodmap "$sysmodmap"
e61737
    [ -r "$usermodmap" ] && xmodmap "$usermodmap"
e61737
fi
e61737
e61737
# run all system xinitrc shell scripts.
e61737
for file in /etc/X11/xinit/xinitrc.d/* ; do
e61737
        . $file
e61737
done
e61737
e61737
# Prefix launch of session with ssh-agent if available and not already running.
e61737
if [ -z "$SSH_AGENT" ] && [ -z "$SSH_AUTH_SOCK" ] && [ -z "$SSH_AGENT_PID" ] && [ -x /usr/bin/ssh-agent ]; then
e61737
    if [ "x$TMPDIR" != "x" ]; then
e61737
        SSH_AGENT="/usr/bin/ssh-agent /bin/env TMPDIR=$TMPDIR"
e61737
    else
e61737
        SSH_AGENT="/usr/bin/ssh-agent"
e61737
    fi
e61737
fi