mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-24 02:46:43 +00:00
Handle retina screens in start-local-collaboration script
This commit is contained in:
parent
f99f581bfc
commit
43b7e16c89
1 changed files with 8 additions and 6 deletions
|
@ -25,9 +25,13 @@ if [[ $username_1 == $username_2 ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make each Zed instance take up half of the screen.
|
# Make each Zed instance take up half of the screen.
|
||||||
screen_size=($(system_profiler SPDisplaysDataType | grep Resolution | head -n1 | egrep -o '[0-9]+'))
|
resolution_line=$(system_profiler SPDisplaysDataType | grep Resolution | head -n1)
|
||||||
width=$(expr ${screen_size[0]} / 2)
|
screen_size=($(echo $resolution_line | egrep -o '[0-9]+'))
|
||||||
height=${screen_size[1]}
|
scale_factor=1
|
||||||
|
if [[ $resolution_line =~ Retina ]]; then scale_factor=2; fi
|
||||||
|
width=$(expr ${screen_size[0]} / 2 / $scale_factor)
|
||||||
|
height=${screen_size[1] / $scale_factor}
|
||||||
|
|
||||||
position_1=0,0
|
position_1=0,0
|
||||||
position_2=${width},0
|
position_2=${width},0
|
||||||
|
|
||||||
|
@ -37,12 +41,10 @@ export ZED_SERVER_URL=http://localhost:8080
|
||||||
export ZED_WINDOW_SIZE=${width},${height}
|
export ZED_WINDOW_SIZE=${width},${height}
|
||||||
|
|
||||||
cargo build
|
cargo build
|
||||||
sleep 0.1
|
sleep 0.5
|
||||||
|
|
||||||
# Start the two Zed child processes. Open the given paths with the first instance.
|
# Start the two Zed child processes. Open the given paths with the first instance.
|
||||||
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
|
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
|
||||||
ZED_IMPERSONATE=${username_1} ZED_WINDOW_POSITION=${position_1} target/debug/Zed $@ &
|
ZED_IMPERSONATE=${username_1} ZED_WINDOW_POSITION=${position_1} target/debug/Zed $@ &
|
||||||
sleep 0.1
|
|
||||||
ZED_IMPERSONATE=${username_2} ZED_WINDOW_POSITION=${position_2} target/debug/Zed &
|
ZED_IMPERSONATE=${username_2} ZED_WINDOW_POSITION=${position_2} target/debug/Zed &
|
||||||
sleep 0.1
|
|
||||||
wait
|
wait
|
||||||
|
|
Loading…
Reference in a new issue