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