How to change character collation in GNOME2 session?

Questions about applications and software
Forum rules
Before you post please read how to get help

Important information

How to change character collation in GNOME2 session?

Postby HTD on Wed Sep 21, 2011 1:18 pm

Exactly: seems easy to find, but no luck so far. I remember I've changed in on Ubuntu, but from the other hand - I don't really remember how.

You'll find it everywhere - LC_COLLATE="...", export LC_COLLATE, yes, but it works only from shell, and only for shell apps. GNOME seems to ignore it.

What's the deal with this collation? Since very old times, Amiga SD floppies - I used "_" and "!" on beginning of directory to make it displayed first. Fast, convenient, life-saver sometimes. But not any more, not in GNOME. There is this STUPID collation which makes "!zed" listed after "zac" which is real PITA for me. Enough - LC_COLLATE="C" and all works as expected. But how? I tried to add it to /etc/init.d before GDM loads, to ~/.rcdm /.bash_profile. No effect. GNOME ignores LC_ variables, I think it overwrites them per user or session from... I don't know where.

BTW, I don't want to change other locale settings, or displayed language. That's what LC_ variables are for. I know Nautilus respect LC_ settings and uses LC_COLLATE for sorting.

Sorting in Nautilus was often reported as bug, which made its developers pissed - well, I don't blame them - why add manual configuration when Nautilus is a part of GNOME and uses its system settings? Anyway, how to change them? :) I mean permanently, I want my "!" and "_" directories on top! And yes, I've searched the friendly Google. None of the things I've found worked.
Level 1
Level 1
Posts: 45
Joined: Sun May 22, 2011 7:31 pm

Linux Mint is funded by ads and donations.

Re: How to change character collation in GNOME2 session?

Postby xenopeek on Wed Sep 21, 2011 1:51 pm

Put this in the /etc/default/locale file. Make sure the LC_ALL is not set in that file, in /etc/bash.bashrc, in ~./bashrc, in /etc/profile or in ~/.bash_profile, as it can't be overridden later on and will block your attempts to change LC_COLLATE.

And note that it's recommended to explicitly set LC_COLLATE to C when dealing with system-wide settings, as some programs are written in such a way that they expect traditional English ordering of the alphabet.
User avatar
Level 23
Level 23
Posts: 17806
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: How to change character collation in GNOME2 session?

Postby HTD on Thu Sep 22, 2011 6:37 am

Setting LC_COLLATE to "C" is exactly what I intended to do.
I've added it to some places and there's no need to remove them.
Except one place - I've added LC_COLLATE="C" to .gtkrc-2.0 and it helped. After further investigation - it helped because it caused error in GTK locale functions making them switch to "C". "Expecting integer" - error message said, so how about zero? :) LC_COLLATE=0 - and well, no error messages. So I tested it with gnome-terminal - again - works as charm.

Well, I'm not too happy it places capital letters on top, but is there a way to do it right?

The most logical and intuitive way of sorting files would be something like this:


Main problem with such changes is they are lost after new installation. Is there a program to list all user customizations? I change a lot in my system. Theoretically - if something in /etc is not installed from a Debian package - it's user's... But how to check it quick? From the other hand - if something is in ~ it's most likely user's, but most of ~/.dotfiles are generated by programs. Some of them are modified by user manually - and those are the interesting ones to backup. Oh, and gconf data... everything which is not default.
Level 1
Level 1
Posts: 45
Joined: Sun May 22, 2011 7:31 pm

Return to Software & Applications

Who is online

Users browsing this forum: No registered users and 1 guest