Xfce Forum

Sub domains
 

You are not logged in.

#1 2023-06-18 16:13:32

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

Thunar sorts files differently than Open & Save As dialog box windows

Could be something I am doing wrong, but I still cannot seem to find any kind of consistancy when it comes to Linux and file sorting methods, even within Desktop Environments themselves.  I noticed that Thunar sorts files differently than the Open & Save As dialog box windows that XFCE provides with programs.
I am trying to use the LC_COLLATE=C method of sorting because it provides the closest thing in Linux to the "Natural" type of file sorting method I am looking for but am finding quite a bit of inconsistancies.

The way I am applying a this sorting method is by going into the following text file
/etc/default/locale
and adding
LC_COLLATE=C

With this setting Thunar provides the sorting method I am looking for, however the Open & Save As dialog box provide different sorting.
I am trying to not provide of ton of file list examples, but I can if needed.
Quick example I can give though has to do with underscores
Sort C in Thunar makes files with underscores appear at top and yet in the Open & Save As dialog box they appear at bottom
Thunar
___Apple.txt
__Apple.txt
_Apple.txt
Apple.txt

I have even tried the LC_COLLATE="en_US.UTF-8" just to test consistancy and still strange.
In fact it appears that LC_COLLATE=C & LC_COLLATE="en_US.UTF-8" with Thunar / Open & Save As
I believe produce four different results of file sorting.

And don't even get me started on the fact that most Desktop Enviroments within Linux sort files using LC_COLLATE=C & "en_US.UTF-8" settings, differently than each other.

Is there some kind of different location where I need to set LC_COLLATE=C for Open & Save As within XFCE?

Thank You for any help provided

Last edited by advice1010 (2023-06-18 16:21:37)

Offline

#2 2023-06-18 20:55:17

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,136

Re: Thunar sorts files differently than Open & Save As dialog box windows

I mentioned in your other thread that the file open/save dialogs used by Xfce are the GtkFileChooser dialog. This is a gnome/Gtk dialog. I'm not sure if its possible to sort that dialog differently, but perhaps you can search gnome/GTK resources whether its possible.


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

#3 2023-06-19 16:20:05

KBar
Moderator
Registered: 2021-11-05
Posts: 689

Re: Thunar sorts files differently than Open & Save As dialog box windows

FileChooser offers three keys related to its sorting, `sort-column` being one of them. It can be set to "name", "modified", or "size":

gsettings set org.gtk.Settings.FileChooser sort-column "name"

Check out /usr/share/glib-2.0/schemas/org.gtk.Settings.FileChooser.gschema.xml for details.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#4 2023-09-05 20:49:38

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

Re: Thunar sorts files differently than Open & Save As dialog box windows

Thank you for the responses.
My journey of trying to understand what the heck is going on with file sorting in Linux continues smile

Someone mentioned something that kind of blew my mind a bit, wondering if anyone could help me understand the following.
I have heard others bring up the terminal ls command when it comes to file sorting, but someone recently brought this up in a way I had not thought about.

I had always assumed that the locale LC_COLLATE=C (or in general) setting was what Thunar used and that is why files sorted a specific way, that it was the LC_COLLATE setting getting applied to Thunar.

However someone mentioned to me that it is possible that FMs such as Thunar are actually applying their own sorting methods, and that the terminal ls command is actually a more accurate representation of how LC_COLLATE is actually sorting.
I was wondering if anyone knows if this is true, is Thunar actually modifying LC_COLLATE sorting results and the ls command is actually what LC_COLLATE=C sorts like?

Either way that now means that all three of the following items all sort files differently!
-Thunar
-Open & Save As
-Terminal ls command
I also plan on using a 3rd party FM that sorts differently as well

I am looking for a natural sort but not available in Xfce, so I went with LC_COLLATE=C which in Thunar is close enough, so this is what I was trying to get everything else to sort like, but it turns out that this might be only a specific sorting method provided by Thunar.

I will make another post below showing the differences with Thunar & ls command if anyone is interested.

I think I have everything figured out good enough to use, but still just seems odd that in Linux no sorting methods are the same throughout my system.

If anyone has any information to share please let me know.
Thank You

Last edited by advice1010 (2023-09-05 20:53:48)

Offline

#5 2023-09-05 20:55:34

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

Re: Thunar sorts files differently than Open & Save As dialog box windows

LC_COLLATE=C

THUNAR (desired result) (would like underscores at top but not possible)
-Numbers
-Underscores
-Letters uppercase / lowercase (together)
Sequential numbering

LS COMMAND
-Numbers
-Letters uppercase
-Underscores
-Letters lowercase
Non sequential numbering

OPEN / SAVE AS DIALOGUES (same as ls command but sequential numbering)
-Numbers
-Letters uppercase
-Underscores
-Letters lowercase
Sequential numbering

Last edited by advice1010 (2023-09-05 21:10:16)

Offline

#6 2023-09-05 23:29:35

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,136

Re: Thunar sorts files differently than Open & Save As dialog box windows

Here are some bug reports that might be interesting:
- https://gitlab.xfce.org/xfce/thunar/-/issues/1015 (bug in glib)
- https://gitlab.xfce.org/xfce/thunar/-/issues/1185 (same glib bug)
- https://gitlab.xfce.org/xfce/thunar/-/issues/775 (feature request)


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