mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 01:34:02 +00:00
Look for the main display always
This commit is contained in:
parent
3c54b14c5b
commit
65c5605e68
1 changed files with 2 additions and 1 deletions
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue