[Pkg-xfce-devel] Bug#735265: Bug#735251: lightdm: user locale tweaks are clobbered by non-default locale

Olaf Meeuwissen olaf.meeuwissen at avasys.jp
Fri Jan 17 04:01:11 UTC 2014

Yves-Alexis Perez writes:

>> > But in any case, setting LANG in .xsessionrc doesn't make much sense
>> > imho.
>> Care to explain why?  For me the correct LANG value is essential to get
>> my input method editor to work correctly (or so it seems).
>> # Of course, setting it in ~/.dmrc works for me but I'd like to know why
>> # I should set it there too.
> The way I see it (as I already explained), you select the wanted locale
> (LANG) in the greeter language selector (and it gets saved to .dmrc for
> later). Then, if you need to “correct” (for LC_MESSAGES for example) you
> can do it un .xsessionrc.

The greeter language selector does not seem to set LANG.  At the very
beginning of the /etc/X11/Xsession script LANG=C.  I change it in my
~/.xsessionrc to ja_JP.UTF-8.  When Xsession finally exec's $STARTUP
the LANG value is still jp_JP.UTF-8.  That notwithstanding, the LANG
value in an Xfce Terminal and XTerm is the value that corresponds with
the one selected/defaulted by the greeter's language selector.

> Now, nobody forces you to do that way, you can do whatever you want in
> .xsessionrc and completely ignore the greeter.
>> See above.  It looks like the LANG value is clobbered later, somewhere
>> in $STARTUP, which in my case is
>>   /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/im-launch x-session-manager
> Then you know where to start looking. But as I said to Simon, that's
> pretty much outside my perimeter (well unless it happens in
> xfce4-session, but that's unrelated to lightdm anyway, and I need to
> pick my Xfce hat).
> With my Xfce hat on, that reminds me of something worth checking. I
> think xfce4-session tries to respect GDM_LANG and overwrites LANG with
> it. LightDM doesn't set GDM_LANG (that's a gdm thing) but I think Simon
> did set it manually at some point, which might then have this side
> effect. Maybe check that's not your case?

Did that.  GDM_LANG is set to whatever the greeter's language selector
has selected/defaulted and it has this throughout the Xsession script,
right from the start all the way to `exec $STARTUP`.

>> I know nobody forces me to do so, but I parse the above as "if you want
>> to modify your locale settings or other environment variables, your
>> ~/.xsessionrc is the place to do so".  Hence, I did and it didn't work
>> as expected.  Maybe there should be some documentation that (at least)
>> LANG should be set elsewhere because $STARTUP may override it?
> Well, anything can modify LANG its the child processes anyway, there's
> nothing the parents can do about that.

Sure, just like any child process can wipe my $HOME directory.  But that
is not the point.  The point is whether child processes should modify my
LANG variable (just because some GDM_LANG value exists with a different
value).  And in this particular case it affects my whole desktop session.

FWIW, lightdm seems to be exporting GDM_LANG, see src/seat.c in the
configure_session() function.  I see it does the same for GDMSESSION.
Are these variables GTK+ or GNOME specific?  If the latter, then maybe
lightdm shouldn't be exporting these, but what do I know?
Just an idea, but why not simply export LANG instead (or as well)?

I'm off nuking GDM_LANG (and maybe GDMSESSION) in my ~/.xsessionrc and
see what breaks ;-)

> In any case, I'm again just confused on all those bugs, but my feeling
> is just that there's no bug in lightdm/lightdm-gtk-greeter here, but
> later in the startup process, so those bugs should either be reassigned
> or just closed, in order top stop confusion.

Hope this helps unconfusing a bit,
Olaf Meeuwissen, LPIC-2           FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962               Help support software freedom

More information about the Pkg-xfce-devel mailing list