~ubuntu-branches/ubuntu/raring/gdm/raring

« back to all changes in this revision

Viewing changes to .pc/ubuntu_i18n_oneiric.patch/data/Xsession.in

  • Committer: Package Import Robot
  • Author(s): Gunnar Hjalmarsson
  • Date: 2012-01-31 17:45:20 UTC
  • Revision ID: package-import@ubuntu.com-20120131174520-5y15hrfu5v9e6orf
Tags: 3.0.4-0ubuntu15
* debian/patches/45_time_display_on_greeter.patch:
  - Adapt to forwarded version of the patch.
  - Let the LANG environment variable serve as fallback when
    determining the display language for the weekday, since LANG
    has been redefined in Ubuntu to represent language instead of
    regional formats. This change also ought to make the patch work
    as intended upstream.
* debian/gdm.upstart:
  - No need to export LC_MESSAGES since it's not set any longer.
* debian/patches/ubuntu_no_LANG_setting_in_Xsession.patch:
  - Renamed from "ubuntu_i18n_oneiric.patch".
  - No need to unset LC_MESSAGES etc. since they are not set any
    longer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!@XSESSION_SHELL@
2
 
#
3
 
# This is SORT OF LIKE an X session, but not quite.  You get a command as the
4
 
# first argument (it could be multiple words, so run it with "eval").  As a
5
 
# special case, the command can be:
6
 
#  default - Run the appropriate Xclients startup (see the code below)
7
 
#  custom - Run ~/.xsession and if that's not available run 'default'
8
 
#
9
 
# (Note that other arguments could also follow, but only the command one is
10
 
# right now relevant and supported)
11
 
#
12
 
# The output is ALREADY redirected to .xsession-errors in GDM.  This way
13
 
# .xsession-errors actually gets more output such as if the PreSession script
14
 
# is failing.  This also prevents DoS attacks if some app in the users session
15
 
# can be prodded to dump lots of stuff on the stdout/stderr.  We wish to be
16
 
# robust don't we?  In case you wish to use an existing script for other DM's,
17
 
# you can just not redirect when GDMSESSION is set.  GDMSESSION will always
18
 
# be set from gdm.
19
 
#
20
 
# Also note that this is not run as a login shell, this is just executed.
21
 
# This is why we source the profile files below.
22
 
#
23
 
# based on:
24
 
# $XConsortium: Xsession /main/10 1995/12/18 18:21:28 gildea $
25
 
 
26
 
command="$@"
27
 
 
28
 
# this will go into the .xsession-errors along with all other echo's
29
 
# good for debugging where things went wrong
30
 
echo "$0: Beginning session setup..."
31
 
 
32
 
# First read /etc/profile and .profile
33
 
test -f /etc/profile && . /etc/profile
34
 
test -f "$HOME/.profile" && . "$HOME/.profile"
35
 
# Second read /etc/xprofile and .xprofile for X specific setup
36
 
test -f /etc/xprofile && . /etc/xprofile
37
 
test -f "$HOME/.xprofile" && . "$HOME/.xprofile"
38
 
 
39
 
# Translation stuff
40
 
if [ -x "@libexecdir@/gdmtranslate" ] ; then
41
 
  gdmtranslate="@libexecdir@/gdmtranslate"
42
 
else
43
 
  gdmtranslate=
44
 
fi
45
 
 
46
 
# Note that this should only go to zenity dialogs which always expect utf8
47
 
gettextfunc () {
48
 
  if [ "x$gdmtranslate" != "x" ] ; then
49
 
    "$gdmtranslate" --utf8 "$1"
50
 
  else
51
 
    echo "$1"
52
 
  fi
53
 
}
54
 
 
55
 
OLD_IFS=$IFS
56
 
 
57
 
gdmwhich () {
58
 
  COMMAND="$1"
59
 
  OUTPUT=
60
 
  IFS=:
61
 
  for dir in $PATH
62
 
  do
63
 
    if test -x "$dir/$COMMAND" ; then
64
 
      if test "x$OUTPUT" = "x" ; then
65
 
        OUTPUT="$dir/$COMMAND"
66
 
      fi
67
 
    fi
68
 
  done
69
 
  IFS=$OLD_IFS 
70
 
  echo "$OUTPUT"
71
 
}
72
 
 
73
 
zenity=`gdmwhich zenity`
74
 
 
75
 
# Note: ~/.xsession-errors is now done in the daemon so that it
76
 
# works for ALL sessions (except ones named 'Failsafe')
77
 
 
78
 
# clean up after xbanner
79
 
freetemp=`gdmwhich freetemp`
80
 
if [ -n "$freetemp" ] ; then
81
 
        "$freetemp"
82
 
fi
83
 
 
84
 
userresources="$HOME/.Xresources"
85
 
usermodmap="$HOME/.Xmodmap"
86
 
userxkbmap="$HOME/.Xkbmap"
87
 
 
88
 
sysresources=/etc/X11/Xresources 
89
 
sysmodmap=/etc/X11/Xmodmap 
90
 
sysxkbmap=/etc/X11/Xkbmap
91
 
 
92
 
rh6sysresources=/etc/X11/xinit/Xresources 
93
 
rh6sysmodmap=/etc/X11/xinit/Xmodmap 
94
 
 
95
 
# merge in defaults
96
 
if [ -f "$rh6sysresources" ]; then
97
 
    xrdb -nocpp -merge "$rh6sysresources"
98
 
fi
99
 
 
100
 
if [ -f "$sysresources" ]; then
101
 
    xrdb -nocpp -merge "$sysresources"
102
 
elif [ -d "$sysresources" ]; then
103
 
    # directory of Xresources files on Debian/Ubuntu
104
 
    for i in `ls "$sysresources"` ; do
105
 
        if [ -r "$sysresources/$i"  -a -f "$sysresources/$i" ] && expr "$i" : '^[[:alnum:]_-]\+$' > /dev/null; then
106
 
            xrdb -nocpp -merge "$sysresources/$i"
107
 
        fi
108
 
    done
109
 
fi
110
 
 
111
 
if [ -f "$userresources" ]; then
112
 
    xrdb -nocpp -merge "$userresources"
113
 
fi
114
 
 
115
 
# merge in keymaps
116
 
if [ -f "$sysxkbmap" ]; then
117
 
    setxkbmap `cat "$sysxkbmap"`
118
 
    XKB_IN_USE=yes
119
 
fi
120
 
 
121
 
if [ -f "$userxkbmap" ]; then
122
 
    setxkbmap `cat "$userxkbmap"`
123
 
    XKB_IN_USE=yes
124
 
fi
125
 
 
126
 
#
127
 
# Eeek, this seems like too much magic here
128
 
#
129
 
if [ -z "$XKB_IN_USE" -a ! -L /etc/X11/X ]; then
130
 
    if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f /etc/X11/XF86Config ]; then
131
 
       xkbsymbols=`sed -n -e 's/^[     ]*XkbSymbols[   ]*"\(.*\)".*$/\1/p' /etc/X11/XF86Config`
132
 
       if [ -n "$xkbsymbols" ]; then
133
 
           setxkbmap -symbols "$xkbsymbols"
134
 
           XKB_IN_USE=yes
135
 
       fi
136
 
    fi
137
 
fi
138
 
 
139
 
# xkb and xmodmap don't play nice together
140
 
if [ -z "$XKB_IN_USE" ]; then
141
 
    if [ -f "$rh6sysmodmap" ]; then
142
 
       xmodmap "$rh6sysmodmap"
143
 
    fi
144
 
 
145
 
    if [ -f "$sysmodmap" ]; then
146
 
       xmodmap "$sysmodmap"
147
 
    fi
148
 
 
149
 
    if [ -f "$usermodmap" ]; then
150
 
       xmodmap "$usermodmap"
151
 
    fi
152
 
fi
153
 
 
154
 
unset XKB_IN_USE
155
 
 
156
 
# Overwrite $LANG from /etc/profile (and friends) with the one picked in the
157
 
# greeter
158
 
if [ -n "$GDM_LANG" ]; then
159
 
  LANG="$GDM_LANG"
160
 
  export LANG
161
 
fi
162
 
 
163
 
# run all system xinitrc shell scripts.
164
 
if [ -d /etc/X11/xinit/xinitrc.d ]; then
165
 
    for i in /etc/X11/xinit/xinitrc.d/* ; do
166
 
        if [ -x "$i" -a ! -d "$i" ]; then
167
 
            . "$i"
168
 
        fi
169
 
    done
170
 
fi
171
 
 
172
 
# run /etc/X11/Xsession.d/
173
 
OPTIONFILE=/etc/X11/Xsession.options
174
 
USERXSESSION=$HOME/.xsession
175
 
USERXSESSIONRC=$HOME/.xsessionrc
176
 
ALTUSERXSESSION=$HOME/.Xsession
177
 
if [ -d /etc/X11/Xsession.d ]; then
178
 
    for i in `ls /etc/X11/Xsession.d/` ; do
179
 
        if [ -r "/etc/X11/Xsession.d/$i"  -a -f "/etc/X11/Xsession.d/$i" ] && expr "$i" : '^[[:alnum:]_-]\+$' > /dev/null; then
180
 
            . "/etc/X11/Xsession.d/$i"
181
 
        fi
182
 
    done
183
 
fi
184
 
 
185
 
if [ "x$command" = "xcustom" ] ; then
186
 
  if [ -x "$HOME/.xsession" ]; then
187
 
    command="$HOME/.xsession"
188
 
  else
189
 
    echo "$0: Cannot find ~/.xsession will try the default session"
190
 
    command="default"
191
 
  fi
192
 
fi
193
 
 
194
 
if [ "x$command" = "xdefault" ] ; then
195
 
  if [ -x "$HOME/.Xclients" ]; then
196
 
    command="$HOME/.Xclients"
197
 
  elif [ -x /etc/X11/xinit/Xclients ]; then
198
 
    command="/etc/X11/xinit/Xclients"
199
 
  elif [ -x /etc/X11/Xclients ]; then
200
 
    command="/etc/X11/Xclients"
201
 
  else
202
 
    if [ -n "$zenity" ] ; then
203
 
        disptext=`gettextfunc "System has no Xclients file, so starting a failsafe xterm session.  Windows will have focus only if the mouse pointer is above them.  To get out of this mode type 'exit' in the window."`
204
 
      "$zenity" --info --text "$disptext"
205
 
    else
206
 
      echo "$0: Cannot find Xclients"
207
 
    fi
208
 
    exec xterm -geometry 80x24+0+0
209
 
  fi
210
 
fi
211
 
 
212
 
# add ssh-agent if found
213
 
sshagent="`gdmwhich ssh-agent`"
214
 
if [ -n "$sshagent" ] && [ -x "$sshagent" ] && [ -z "$SSH_AUTH_SOCK" ]; then
215
 
    command="$sshagent -- $command"
216
 
elif [ -z "$sshagent" ] ; then
217
 
    echo "$0: ssh-agent not found!"
218
 
fi
219
 
 
220
 
echo "$0: Setup done, will execute: $command"
221
 
 
222
 
eval exec $command
223
 
 
224
 
echo "$0: Executing $command failed, will run xterm"
225
 
 
226
 
if [ -n "$zenity" ] ; then
227
 
        disptext=`gettextfunc "Failed to start the session, so starting a failsafe xterm session.  Windows will have focus only if the mouse pointer is above them.  To get out of this mode type 'exit' in the window."`
228
 
        "$zenity" --info --text "$disptext"
229
 
fi
230
 
 
231
 
exec xterm -geometry 80x24+0+0