21-lightdm-locale-fix 572 Bytes
Newer Older
Christopher R. Gabriel's avatar
Christopher R. Gabriel committed
1
2
3
#!/bin/sh
# workaround for session language selection in lightdm greeter
# we need this only if lightdm is being used
4
if pidof lightdm; then
5
	if ([ -e $HOME/.dmrc ] && [ $(grep 'Language' $HOME/.dmrc) ]) ; then
6
7
	# use Language setting from ~/.dmrc
	export LANG=`cat "$HOME/.dmrc" | grep '^Language=' | cut -d '=' -f 2- | sed 's/utf8/UTF-8/'`
Christopher R. Gabriel's avatar
Christopher R. Gabriel committed
8

9
10
11
12
13
14
15
16
	# if $LANGUAGE is set, sync it with chosen locale
	[ -n "$LANGUAGE" ] && export LANGUAGE=$LANG
	# align LC_MESSAGES too
	export LC_MESSAGES=$LANG
	# remove untrustworthy $GDM_LANG
	[ -n "$GDM_LANG" ] && unset GDM_LANG
    fi
fi