You are not logged in.

#1 2009-08-27 19:10:03

johnpatcher
Member
Registered: 2009-08-23
Posts: 70

[SOLVED] Changing the locale - Run into problem

Hi,

I want to have my Arch in English, but at least the time should be shown in german conventions, as I'm from Germany wink.

I couldn't find a way to set "LC_TIME" in general for the whole machine, the only way I could figure out is to use a ".profile" file in the home directory.

So I have created a file with the following content:
.profile

export LC_TIME=de_DE.UTF-8

And placed it in root's homedir /root/.

After logging out and logging in again the locale is changed, so it works as it is supposed to be.

But I also want to change the locale for a normal user called "johnpatcher". Therefore I created a file with the same content in /home/johnpatcher.

But after logging in with the user johnaptcher LC_TIME still remains "en_US.UTF-8", which is quite strange to me.

What have I done wrong? Are there any better solutions to change a locale globally for the whole machine?

I know that I also could try to use the ".bashrc" file, but the ".profile" should work, regardless of what shell I'm using and it actually does for root, but not for a normal user sad.

Best regards
johnpatcher

Last edited by johnpatcher (2009-08-28 14:10:11)

Offline

#2 2009-08-28 06:43:44

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [SOLVED] Changing the locale - Run into problem

Ya, I don't know... Sorry. defendantaly a permissions problem but hard to think of a way around it in this pertitular case. Maybe look for an application level solution?


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#3 2009-08-28 12:13:16

johnpatcher
Member
Registered: 2009-08-23
Posts: 70

Re: [SOLVED] Changing the locale - Run into problem

hunterthomson wrote:

defendantaly a permissions problem

The file "/home/johnpatcher/.profile" is chmoded to 0777, so normally there shouldn't be any problem with the permission.

Offline

#4 2009-08-28 12:13:54

Surgat_
Member
Registered: 2007-08-08
Posts: 317

Re: [SOLVED] Changing the locale - Run into problem

I think that the correct place to put that line is in /etc/rc.local, so that it works system-wide.

Offline

#5 2009-08-28 12:45:41

johnpatcher
Member
Registered: 2009-08-23
Posts: 70

Re: [SOLVED] Changing the locale - Run into problem

Surgat_ wrote:

I think that the correct place to put that line is in /etc/rc.local, so that it works system-wide.

That would probably work just fine, but, to be honest, I want to run my system in English completly, while the user I'm working with (johnpatcher) has some german locales set. I can't understand why something that works just fine for "root" doesn't work for any other user sad. Quite strange ...

Offline

#6 2009-08-28 13:05:55

Maxa
Member
Registered: 2008-11-30
Posts: 31

Re: [SOLVED] Changing the locale - Run into problem

I use the same 'hack' and it works here (tm)

In X, starting with "bash --login" sources .profile (http://wiki.archlinux.org/index.php/Sta … logging_in)
If it happens also with agetty... maybe you have .bash_profile/.bash_login that gets sourced instead?

Offline

#7 2009-08-28 13:55:17

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [SOLVED] Changing the locale - Run into problem

The easiest would be to put it into ~/.bashrc  asuming that you use bash

edit:
@ Surgat_

/etc/profile.d/custom.sh or similar would be a more propper place.

Last edited by Mr.Elendig (2009-08-28 13:57:01)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#8 2009-08-28 14:09:26

johnpatcher
Member
Registered: 2009-08-23
Posts: 70

Re: [SOLVED] Changing the locale - Run into problem

Maxa wrote:

In X, starting with "bash --login" sources .profile (http://wiki.archlinux.org/index.php/Sta … logging_in)

I haven't installed X yet, I'm just refering to the console.

Maxa wrote:

If it happens also with agetty... maybe you have .bash_profile/.bash_login that gets sourced instead?

You are right, ".bash_profile" gets sourced, which contains:

. $HOME/.bashrc

I have changed it to:

. $HOME/.profile
. $HOME/.bashrc

It works now as expected. The root user has no .bash_profile, which explains why it has worked for him without any problem, thanks for the advise wink. Removing the file completly works also, although the file could be needed wink.

Last edited by johnpatcher (2009-08-28 14:09:57)

Offline

Board footer

Powered by FluxBB