Blame SOURCES/xinitrc-common

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