Xfce Forum

Sub domains
 

You are not logged in.

#1 2023-02-19 17:03:55

advice1010
Member
Registered: 2023-02-19
Posts: 65

Natural sort for file sorting for enitre system

I was wondering if there is anyway to be able to change the sorting method to more of a "natural sort" sorting method.
I am looking for a setting that sets this on a global level for entire system, so that all applications use it such as Thunar, open dialog, save as dialogs, etc.  I am not talking about command lind list commands.

Currently I have noticed that almost all desktop environments only offer basically 2 types of methods for sorting files...
1.) Based on your speaking language    example:   US English
2.) The other is a LC_COLLATE=C

but unfortunately neither provide the file sorting I desire.

The main properties I am looking for are....
1.) Underscores at top and the more underscores added the higher those files are on the list
2.) Natural sorting number where 1, 2, 3, 10, 11  instead of  1, 10, 11, 2, 3
3.) letter case ignored

Example:
__1
__2
__10
__A
__a
_1
_2
_10
_A
_a
1
2
10
Apple (1)
apple (2)
apple (3)
Apple (10)
Apple (11)


I have only found one desktop environment that offers a natural sorting method in the Linux ecosystem, but proves that it is possible.
I was wondering if there is any way of achieving this in XFCE?
I really would like to give XFCE a try as my desktop enviroment, but not being able to do this is keeping me from doing so at the moment.

Thank you for any help provided

Last edited by advice1010 (2023-02-25 20:23:26)

Offline

#2 2023-02-22 23:08:12

advice1010
Member
Registered: 2023-02-19
Posts: 65

Re: Natural sort for file sorting for enitre system

Yikes that is what I was afraid of, no responses for this.
I was hoping some kind of setting would be available in XFCE for this.

What makes it even worse is when I do research online about this I keep getting sites about command line "list" commands for sorting.

I have seen some mention that all the "locale" settings are based off of a file named "iso14651_t1_common" in the "usr/share/i18n/locales" folder" but seems rather complicated because I don't know what each of those line items refer to.
I have to look around and see if there is any info on what each of those items mean.

You would think different sorting method files would be included in Linux itself or at least some website to be able to download them.
I have seen others interested in this but how can it be that this hasn't been solved by someone a great deal smarter than I am by now, it is 2023.

If I was going to edit a sorting file it would probably be the "C" file in this folder which is what "LC_COLLATE=C" uses.
This sorting method is the closest to what I am looking for and seems the simplest to edit (but that is not saying much) you can see that it shows a list of codes that are linked to the "iso14651" file I mention above.
"LC_COLLATE=C" achieves some of the preferences I am looking for but has issues with files with numbers.  Puts numbers at the top instead of underscores and also messes up sequential number order.

Hopefully there is an easier way to achieve what I am looking for?

If anyone has any solutions please let me know, thank you.

Last edited by advice1010 (2023-02-25 20:22:47)

Offline

#3 2023-02-22 23:51:13

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,949

Re: Natural sort for file sorting for enitre system

I understand your request but I don't have an answer. And perhaps no-one here does. In which case, I would recommend creating an issue report and have the developer respond (he doesn't visit these forums).

I have only found one desktop environment that offers a natural sorting method in the Linux ecosystem, but proves that it is possible.

Out of curiosity, which file manager is this?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#4 2023-02-23 16:32:20

advice1010
Member
Registered: 2023-02-19
Posts: 65

Re: Natural sort for file sorting for enitre system

@ToZ
Thank you for your response.
No secret, I was trying not to mention names of other projects because I have seen some developers freaking out when people ask for features from other desktop environments / programs,  but since you specifically asked I was refering to KDE Plasma.

They are the only desktop environment that I have found that offers a global system wide natural sorting approach.
It appears to just be naturally part of their locale En_US setting?  Meaning as far as I know I don't think users who DON'T want natural setting are able to get them?  It also has the standard alternative "C" sorting method.
The setting applies globally to file manager, open dialog, save as dialogs, etc.

Their file manager Dolphin also has a setting section in it for choosing between different sorting methods, one of which is "natural".

I thought maybe I could just use their edited locale files and use them elsewhere but as far as I remember I don't think they were different they were just the standard gnu locales based files but I could be wrong, hard to say that iso file I mentioned has a lot of stuff in it.

Before anyone asks, why would I not just use Plasma, two reasons....
1.) Their is a developers coding decision that I can't stand that cannot be turned off and they don't know how to fix it either.
2.) I would like to use XFCE if possible, excited about all the new features being added.  Not perfect, there are certain features that are not included yet, but I have some ideas to share if interested, mainly regarding Thunar.
Thunar is really getting some good stuff, very excited about its development.

Anyways hope this helps

Also just a side note, I know I am new here but I have browsed this forum quite a bit and I see you helping tons of people with some great information, just wanted to point that out, thank you.

Last edited by advice1010 (2023-02-23 16:39:51)

Offline

#5 2023-02-23 20:15:01

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,949

Re: Natural sort for file sorting for enitre system

Thanks for the information. This bug report might be of interest to you. A comment there suggests using LC_COLLATE=C but you indicated that you tried and it didn't work. However, I notice mixed case in your post. Did you try with all uppercase and with the thunar daemon stopped?

thunar -q
LC_COLLATE=C thunar

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#6 2023-02-25 20:21:44

advice1010
Member
Registered: 2023-02-19
Posts: 65

Re: Natural sort for file sorting for enitre system

@Toz
Thank you for your response.
No when I tried this out many times over the years I always use all caps, don't know why I did that, I will fix it.

Funny you mentioned the "C" again because I actually tried it out again the other day when trying to compare which sort would be easiest to modify if I have to.
As just mentioned I have tried this "C" sort out a couple times here and there and the crazy thing is, is that even though this is a standard sorting system, the distros / file managers that I have tried it out on over the years have produced different results!
I won't mention any names but....
One would mess up any sequential numbering,  so instead of 1 2 3 10 it would show 1 10 2 3.
Another one I tried put numbers at top, then capital letters, then underscores, then lower case letters after which was the strangest one of all I have seen.

So my view of "C" over the years was skewed from these instances.
Trying it out in XFCE which I believe uses "C" the way it is supposed to work, actually isn't that bad overall, if I am not able to edit a the sorting files, I think I will be able to use it.  I will still have to adjust alot of files but not as many as I thought.  Main thing is the sequential numbering at least is normal, that one would have been tricky.

As far as editing the sorting files, as mentioned I have actually seen people that have done it.  In their examples they make copies of the sorting files and then edit them and compile them to new names.  I was hoping that because it was just a text file that I would be able to edit the originals (I made copies first) so that I would not have to compile anything (because I do not know how to) but the couple simple edits I made did not show up unfortunately, unless I did not do something correctly.  I made the edits with root access.

Anyways, not something that I will probably get too much interest from others with here, but was just hoping that maybe XFCE had something built in that I was overlooking.

Thanks again for your help and as mentioned for all the great help you are offering everyone here, I know you are an administrator but still I have been to many sites where the administrators don't really offer any advice, so thank you.

Offline

#7 2023-03-16 14:25:48

jth
Member
From: Freiberg (Saxony), Germany
Registered: 2012-09-14
Posts: 10
Website

Re: Natural sort for file sorting for enitre system

Hi,

this is somehow strange... I'm searching for exactly the vice versa... my xfce4, which is 4.12.1... something (opensuse leap 15.1) sorts naturally only (thunar and all file dialogs):

p3cc.pdf
p9xx.xml
p45b1.xml
p170.pdf

and I hate that. The numbers are builded from programs outputting these files and they are named by there positions in menues, e.g. p451,p452,...p459,p45a,p45b,p45c... and by this "natural" sorting p45b is followed by p111 and p451 comes a lot later.

No idea, what causes this, maybe the german collating, but

set
tells me:

LANG=de_DE.UTF-8
LANGUAGE=
LC_COLLATE=C

so I will have a look on this next time...

cu

jth

Offline

#8 2023-03-16 15:22:41

jth
Member
From: Freiberg (Saxony), Germany
Registered: 2012-09-14
Posts: 10
Website

Re: Natural sort for file sorting for enitre system

Hi oncemore,

lurking around I found the xconf settings dialogue in the settings (dunno how it's named in english lang, I've a german lang setting) ... there are settings for several xfce programs and among them thunar and here "last-sort-order". My actual value is "GTK_SORT_ASCENDING", changed it to "GTK_SORT_DESCENDING" and got the above mentioned "natural" sorting as before but descending...

I wonder if I can find the possible other values ... a net post I found by searching for "thunar sorting" said something about "MISC_CASE_SENSITIVE", but this didn't make any change, stays the way it was...
Maybe it's worth to play with some possible values... e.g. "LC_COLLATE" ... but it's somehow strange that there is no info to find out, what are the possible values.
But there is exactly the point to change the sorting in all xfce file dialogues...

cu jth

Offline

#9 2023-03-16 16:38:23

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,949

Re: Natural sort for file sorting for enitre system

jth wrote:

but it's somehow strange that there is no info to find out, what are the possible values.

Here are the possible values that Gtk.SortType provides.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB