diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-09-05 20:10:01 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-09-05 20:10:01 +0300 |
| commit | 608ab7d8b175167f072e09661b1819fc66369a15 (patch) | |
| tree | d24be4faff8d5ecfcab7aac0a2dbc168a9f1be57 /src/ipc | |
| parent | fd8ebb9d06ee6012b948042da794a0104096549e (diff) | |
| download | niri-608ab7d8b175167f072e09661b1819fc66369a15.tar.gz niri-608ab7d8b175167f072e09661b1819fc66369a15.tar.bz2 niri-608ab7d8b175167f072e09661b1819fc66369a15.zip | |
Change output sorting to match make/model/serial first
We can do this now that we have libdisplay-info.
Diffstat (limited to 'src/ipc')
| -rw-r--r-- | src/ipc/client.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ipc/client.rs b/src/ipc/client.rs index 692b39b1..fcbf4b8c 100644 --- a/src/ipc/client.rs +++ b/src/ipc/client.rs @@ -1,4 +1,5 @@ use anyhow::{anyhow, bail, Context}; +use niri_config::OutputName; use niri_ipc::socket::Socket; use niri_ipc::{ Event, KeyboardLayouts, LogicalOutput, Mode, Output, OutputConfigChanged, Request, Response, @@ -120,8 +121,11 @@ pub fn handle_msg(msg: Msg, json: bool) -> anyhow::Result<()> { return Ok(()); } - let mut outputs = outputs.into_iter().collect::<Vec<_>>(); - outputs.sort_unstable_by(|a, b| a.0.cmp(&b.0)); + let mut outputs = outputs + .into_values() + .map(|out| (OutputName::from_ipc_output(&out), out)) + .collect::<Vec<_>>(); + outputs.sort_unstable_by(|a, b| a.0.compare(&b.0)); for (_name, output) in outputs.into_iter() { print_output(output)?; |
