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 |
---|
16 | if [ -r /etc/profile.d/lang.sh ]; then |
---|
17 | . /etc/profile.d/lang.sh |
---|
18 | fi |
---|
19 | |
---|
20 | userresources=$HOME/.Xresources |
---|
21 | usermodmap=$HOME/.Xmodmap |
---|
22 | userxkbmap=$HOME/.Xkbmap |
---|
23 | |
---|
24 | sysresources=/etc/X11/Xresources |
---|
25 | sysmodmap=/etc/X11/Xmodmap |
---|
26 | sysxkbmap=/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 |
---|
33 | if [ -r "$sysxkbmap" ]; then |
---|
34 | setxkbmap $(cat "$sysxkbmap") |
---|
35 | XKB_IN_USE=yes |
---|
36 | fi |
---|
37 | |
---|
38 | if [ -r "$userxkbmap" ]; then |
---|
39 | setxkbmap $(cat "$userxkbmap") |
---|
40 | XKB_IN_USE=yes |
---|
41 | fi |
---|
42 | |
---|
43 | # xkb and xmodmap don't play nice together |
---|
44 | if [ -z "$XKB_IN_USE" ]; then |
---|
45 | [ -r "$sysmodmap" ] && xmodmap "$sysmodmap" |
---|
46 | [ -r "$usermodmap" ] && xmodmap "$usermodmap" |
---|
47 | fi |
---|
48 | |
---|
49 | unset XKB_IN_USE |
---|
50 | |
---|
51 | # run all system xinitrc shell scripts. |
---|
52 | for file in /etc/X11/xinit/xinitrc.d/* ; do |
---|
53 | . $file |
---|
54 | done |
---|
55 | |
---|
56 | # Prefix launch of session with ssh-agent if available and not already running. |
---|
57 | SSH_AGENT= |
---|
58 | if [ -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 |
---|
64 | fi |
---|
65 | |
---|
66 | CK_XINIT_SESSION= |
---|
67 | if [ -z "$XDG_SESSION_COOKIE" ] && [ -x /usr/bin/ck-xinit-session ]; then |
---|
68 | CK_XINIT_SESSION="/usr/bin/ck-xinit-session" |
---|
69 | fi |
---|