Skip to content

Sort chips by name#10

Open
thatguystone wants to merge 1 commit into
hramrach:developmentfrom
thatguystone:master
Open

Sort chips by name#10
thatguystone wants to merge 1 commit into
hramrach:developmentfrom
thatguystone:master

Conversation

@thatguystone

Copy link
Copy Markdown

It's nice to have the output of sensors be stable across reboots, and sorting by name seems pretty natural.

I'm not sure if this is the right place since it makes it part of libsensors, but it also doesn't look like it hurts anything.

@hramrach

Copy link
Copy Markdown
Owner

I think this belongs to the consumer of the data.

Does

sensors -J | jq -S .

produce a stable output?

@hramrach hramrach force-pushed the development branch 3 times, most recently from 8a41efc to 0b5fc76 Compare April 27, 2026 07:53
@thatguystone

Copy link
Copy Markdown
Author

sensors -J | jq -S .

That does produce stable output, but it's also (on my machine) 938 lines vs 89 lines from sensors, so it's not exactly usable.

@hramrach

hramrach commented May 20, 2026

Copy link
Copy Markdown
Owner

If you want less lines

sensors -J | sq -Sc .

is only one line, even 'better' than

sensors

@thatguystone

Copy link
Copy Markdown
Author

Personally, I just prefer when commands produce stable output by themselves without having to pipe around.

@hramrach

Copy link
Copy Markdown
Owner

Personally I prefer that the command provides all the information, and users pick what they want to display, and in what way. That's what -J option is for.

@hramrach hramrach force-pushed the development branch 2 times, most recently from a2ab4c5 to 3ba5942 Compare May 24, 2026 17:33
@thatguystone

Copy link
Copy Markdown
Author

Fair enough. This change feels rather small, so I didn't think it'd be a big deal. But it's your project, your call.

@hramrach

Copy link
Copy Markdown
Owner

The 'traditional' output is too quirky to fix.

While this particular change could work (although I am not sure about the soundness of sorting the chips) there are other problems that cannot be fixed without changing the format.

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