aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ipc/client.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ipc/client.rs b/src/ipc/client.rs
index 4709f57a..ca472e11 100644
--- a/src/ipc/client.rs
+++ b/src/ipc/client.rs
@@ -248,6 +248,13 @@ pub fn handle_msg(msg: Msg, json: bool) -> anyhow::Result<()> {
bail!("unexpected response: expected OutputConfigChanged, got {response:?}");
};
+ if json {
+ let response =
+ serde_json::to_string(&response).context("error formatting response")?;
+ println!("{response}");
+ return Ok(());
+ }
+
if response == OutputConfigChanged::OutputWasMissing {
println!("Output \"{output}\" is not connected.");
println!("The change will apply when it is connected.");