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