Hi,
I've eventually managed to produce a very preliminary version of a
standalone localed daemon at https://github.com/pierre-labastie/blocaled.
I'd like this daemon to be usable on blfs (SysV), because it is needed
for smooth operation of gnome. But we have a problem with configuration
files. localed assumes there are three configuration files:
- one for locale settings, containing variable assignments in shell
syntax, for setting LANG and LC_* variables. On systemd, this is the
/etc/locale file. On openrc, this is the /etc/conf.d/02locale file.
- one for keyboard settings, containing variable assignments in shell
syntax, for setting KEYBOARD and KEYBOARD_TOGGLE variables (this file
may contain other assignments, for example setting FONT, but the other
variables are not used by localed). On systemd, this the /etc/vconsole
file. On openrc, this is the /etc/conf.d/keymaps file.
- one for X11 keyboard settings, in Xorg conf syntax, for setting
XkbLayout, XkbModel, XkbVariant and XkbOptions. On systemd, this is the
/etc/X11/xorg.conf.d/00-keyboard.conf file. On openrc, this is the
/etc/X11/xorg.conf.d/30-keyboard.conf file.
Right now, the name of those files are hard coded in the program. I plan
to at least give users the choice of the names at build time (and maybe
later add a config file containing those filenames, that would be parsed
when the daemon starts). On BLFS, two of those files are straightforward
to find: /etc/sysconfig/console for the keyboard settings, and
/etc/X11/xorg.conf.d/xx-whatever.conf for the X11 keyboard. But the
locale is set in /etc/profile or /etc/profile.d/i18n.sh, in a format
which is _not_ compatible with what is expected by the daemon (the
"export" keyword is not expected)...
So here is a proposition:
- define a locale config file in a format expected by the daemon (say
/etc/sysconfig/locale)
- replace the current /etc/profile.d/i18n.fr with:
---------------------
source /etc/sysconfig/locale
for var in LANG LC_TYPE LC_NUMERIC LC_TIME \
LC_COLLATE LC_MONETARY LC_MESSAGES \
LC_PAPER LC_NAME LC_ADDRESS \
LC_TELEPHONE LC_MEASUREMENTS LC_IDENTIFICATION; do
# Add LANGUAGE and LC_ALL to the above list if needed
[ -n "${!var}" ] && export $var
done
---------------------
This replacement would be done on the blocaled page, so that users not
needing the daemon can have the same files as usual.
Would it be OK?
Another possibility is to write a parser for our i18n.sh (both reading
and writing!), but I do not like it for two reasons:
- that would not be compatible anymore with other distros
- that might take a long time to get it right and find all corner cases...
Regards
Pierre
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page