Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workspace ordering allowing for names of kind <number>:<_rest> to be deterministic. #802

Closed

Conversation

PoutineSyropErable
Copy link

…back to alphanumeric sorting then, which is locale dependant?? Works differently on differnt machine. (Workspace 10: is first on one machine, and last one another. I prefer last . So, I added some code to check if it can be n: and then order with that n. It should try to order following , :_rest, lexixographical fallback.

for stuff like that:

	name_map.1 = "1: "  
	name_map.2 = "2: "  
	name_map.3 = "3: "  
	name_map.4 = "4: "  
	name_map.5 = "5:󰄨 "  
	name_map.6 = "6: "  
	name_map.7 = "7: "  
	name_map.8 = "8: "  
	name_map.9 = "9:󰯂 "  
	name_map.10 = "10: " 

Now, 10 is consistently at the end.

…back to alphanumeric sorting then, which is locale dependant?? Works differently on differnt machine. (Workspace 10:<icon> is first on one machine, and last one another. I prefer last . So, I added some code to check if it can be n:<rest> and then order with that n. It should try to order following <n>, <n>:_rest, lexixographical fallback.
@JakeStanger
Copy link
Owner

While I think having some form of solution for this is good, I'm going to close this PR because the implementation is specific to your configuration. Any other format won't work with it.

This looks like it may have come about due to the switch from sorting by name to sorting by label here #799? If that's the case then perhaps a better solution would be to add a new sorting option, perhaps alphanumeric_name that uses the name from the compositor instead of the name_map label.

@JakeStanger JakeStanger closed this Dec 8, 2024
@PoutineSyropErable
Copy link
Author

PoutineSyropErable commented Dec 15, 2024

Idk how the comment was incomplete.
I just quickly glued it together.
Basically, I have the names be :, which isn't a number so it falls back to lexicographical ordering.
Weirdly enough, on both machine, the lexi ordering differed, and I couldn't fix it, even by copying locale.

Using chatgpt (I'm not a rust user), I quickly I implemented :<_rest> ->
example: 12: lol -> 12
Just as a proof of concept.

What might be useful, would be to sort by different patterns which extract the numbers.
Or... like with other Bar/Workspace programs, have an option to sort by workspace index, and not name.

If you go the sorting route:
Other sorting order like (just take the numbers in the name and assume its one number),

example: 1aabb2 -> 112 (just numbers)

or just take the leftmost or rightmost number

11aabb2 -> 11 (right)
or
11aabb2 -> 2 (left)

Just a feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants