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