source: projects/specs/trunk/x/xorg-x11-xinit/xinitrc-common @ 10989

Revision 10989, 1.9 KB checked in by iwaim, 7 years ago (diff)

xorg-x11-xinit: add flies

Line 
1# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This
2# copyrighted material is made available to anyone wishing to use, modify,
3# copy, or redistribute it subject to the terms and conditions of the
4# GNU General Public License version 2.
5#
6# You should have received a copy of the GNU General Public License
7# along with this program; if not, write to the Free Software
8# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
9
10# xinitrc-common
11#
12# This is common code shared by both Xsession and xinitrc scripts.  Be sure
13# to take this into account when fixing bugs or adding new functionality.
14
15# Set up i18n environment
16if [ -r /etc/profile.d/lang.sh ]; then
17  . /etc/profile.d/lang.sh
18fi
19
20userresources=$HOME/.Xresources
21usermodmap=$HOME/.Xmodmap
22userxkbmap=$HOME/.Xkbmap
23
24sysresources=/etc/X11/Xresources
25sysmodmap=/etc/X11/Xmodmap
26sysxkbmap=/etc/X11/Xkbmap
27
28# merge in defaults
29[ -r "$sysresources" ] && xrdb -nocpp -merge "$sysresources"
30[ -r "$userresources" ] && xrdb -merge "$userresources"
31
32# merge in keymaps
33if [ -r "$sysxkbmap" ]; then
34    setxkbmap $(cat "$sysxkbmap")
35    XKB_IN_USE=yes
36fi
37
38if [ -r "$userxkbmap" ]; then
39    setxkbmap $(cat "$userxkbmap")
40    XKB_IN_USE=yes
41fi
42
43# xkb and xmodmap don't play nice together
44if [ -z "$XKB_IN_USE" ]; then
45    [ -r "$sysmodmap" ] && xmodmap "$sysmodmap"
46    [ -r "$usermodmap" ] && xmodmap "$usermodmap"
47fi
48
49unset XKB_IN_USE
50
51# run all system xinitrc shell scripts.
52for file in /etc/X11/xinit/xinitrc.d/* ; do
53        . $file
54done
55
56# Prefix launch of session with ssh-agent if available and not already running.
57SSH_AGENT=
58if [ -z "$SSH_AGENT_PID" ] && [ -x /usr/bin/ssh-agent ]; then
59    if [ "x$TMPDIR" != "x" ]; then
60        SSH_AGENT="/usr/bin/ssh-agent /bin/env TMPDIR=$TMPDIR"
61    else
62        SSH_AGENT="/usr/bin/ssh-agent"
63  fi
64fi
65
66CK_XINIT_SESSION=
67if [ -z "$XDG_SESSION_COOKIE" ] && [ -x /usr/bin/ck-xinit-session ]; then
68    CK_XINIT_SESSION="/usr/bin/ck-xinit-session"
69fi
Note: See TracBrowser for help on using the repository browser.