You are not logged in.
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
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
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!
Offline
Thank you for the responses.
My journey of trying to understand what the heck is going on with file sorting in Linux continues
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
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
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
[ Generated in 0.009 seconds, 7 queries executed - Memory usage: 548.11 KiB (Peak: 548.95 KiB) ]