[Pkg-xfce-devel] Bug#679386: (no subject)

Vladimir K pzs-fs at yandex.ru
Mon Oct 22 15:53:56 UTC 2012


My snippet decomposes $LANG by fields. Luckily, each delimiter in $LANG syntax is different, so it should be fairly reliable.

added lightdm check, so this script does not mess with any other DM.

/etc/X11/Xsession.d/39-lightdm-dmrc-fix:
--------------
#!/bin/bash

# workaround for session language selection in lightdm greeter
# use .dmrc or accountsservice data (if accounts-daemon is running)

# we need this only if lightdm is being used
if pidof lightdm
then
	# if accountsservice is used, get info from there.
	if pidof accounts-daemon
	then
		LANGFILE="/var/lib/AccountsService/users/$USER"
	# if not, use .dmrc
	else
		LANGFILE="$HOME/.dmrc"
	fi

	# extract, fix and export $LANG
	TEMPLANG=$(cat "$LANGFILE" | grep ^Language= | cut -d '=' -f 2 | sed 's/utf8/UTF8/')
	[ ! -z "$TEMPLANG" ] && export LANG=$TEMPLANG
	# convert $LANG to $LANGUAGE and export
	TEMPLANGUAGE="$(echo $LANG | cut -d '@' -f 1 | cut -d '.' -f 1):$(echo $LANG | cut -d '@' -f 1 | cut -d '.' -f 1 | cut -d '_' -f 1)"
	[ ! -z "$TEMPLANGUAGE" ] && export LANGUAGE=$TEMPLANGUAGE

fi
--------------



More information about the Pkg-xfce-devel mailing list