Re: [dev] [wmii] Locale problem with "uptime" (loadavg in status bar) and a suggestion

From: Robert Ransom <rransom.8774_AT_gmail.com>
Date: Thu, 15 Jul 2010 00:00:51 -0700

On Wed, 14 Jul 2010 14:08:32 +0200
nico <nico_AT_lifeisabug.com> wrote:

> Hello there,
>
> i changed my systems locales to de_DE.UTF-8 and now the command "uptime"
> is using "," instead of "." because of LC_NUMERIC now being set to German
> too. As a result of this the loadavg part of the default statusbar looks
> like "131 087 071" (no dots since commas are removed by sed).
> I have tried several things to make it work but I was not sucessful.
> LC_NUMERIC _must_ be exported to make it work correctly, since uptime is
> called from a subshell. Exporting LC_NUMERIC to an English locale is not an
> option.
>
> Now, I don't know how to make that status command respecting a different
> locale.

Setting LC_NUMERIC is the only way I can think of. But you don't need
that status command.

On Linux 2.6.34.1 (and many other versions):

$ cat /proc/loadavg

(I assume the kernel doesn't try to read and act on locale environment
variables. Yet.)

On FreeBSD 8.0-RELEASE-p? (and probably other versions), see
getloadavg(3).

Robert Ransom

Received on Thu Jul 15 2010 - 09:00:51 CEST

This archive was generated by hypermail 2.2.0 : Thu Jul 15 2010 - 09:12:02 CEST