gnome-session.in 800 Bytes
Newer Older
1
2
#!/bin/sh

3
4
if [ "x$XDG_SESSION_TYPE" = "xwayland" ] &&
   [ "x$XDG_SESSION_CLASS" != "xgreeter" ] &&
5
6
7
8
   [  -n "$SHELL" ] &&
   grep -q "$SHELL" /etc/shells &&
   ! (echo "$SHELL" | grep -q "false") &&
   ! (echo "$SHELL" | grep -q "nologin"); then
9
10
11
12
13
14
15
  if [ "$1" != '-l' ]; then
    exec bash -c "exec -l '$SHELL' -c '$0 -l $*'"
  else
    shift
  fi
fi

16
SETTING=$(G_MESSAGES_DEBUG='' gsettings get org.gnome.system.locale region)
17
18
19
20
REGION=${SETTING#\'}
REGION=${REGION%\'}

if [ -n "$REGION" ]; then
21
22
23
24
25
26
27
28
29
  unset LC_TIME LC_NUMERIC LC_MONETARY LC_MEASUREMENT LC_PAPER

  if [ "$LANG" != "$REGION" ] ; then
    export LC_TIME=$REGION
    export LC_NUMERIC=$REGION
    export LC_MONETARY=$REGION
    export LC_MEASUREMENT=$REGION
    export LC_PAPER=$REGION
  fi
30
31
32
fi

exec @libexecdir@/gnome-session-binary "$@"