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