From 65c5605e683e3294b4c050cdf951dd36103675c0 Mon Sep 17 00:00:00 2001 From: Petros Amoiridis Date: Fri, 21 Apr 2023 17:18:01 +0300 Subject: [PATCH] Look for the main display always --- script/start-local-collaboration | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/start-local-collaboration b/script/start-local-collaboration index c71200f488..b8632c4c22 100755 --- a/script/start-local-collaboration +++ b/script/start-local-collaboration @@ -32,7 +32,8 @@ fi # Make each Zed instance take up half of the screen. output=$(system_profiler SPDisplaysDataType -json) -resolution=$(echo "$output" | jq -r '.SPDisplaysDataType[0].spdisplays_ndrvs[] | select(.spdisplays_online == "spdisplays_yes") | ._spdisplays_resolution') +main_display=$(echo "$output" | jq '.SPDisplaysDataType[].spdisplays_ndrvs[] | select(.spdisplays_main == "spdisplays_yes")') +resolution=$(echo "$main_display" | jq -r '._spdisplays_resolution') width=$(echo "$resolution" | jq -Rr 'match("(\\d+) x (\\d+)").captures[0].string') half_width=$(($width / 2)) height=$(echo "$resolution" | jq -Rr 'match("(\\d+) x (\\d+)").captures[1].string')