mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-01-22 13:18:34 -05:00
Apparently Steam running the OBS launch script makes it run inside Rosetta as well, so it ended up launching the x86 version even on arm64 systems. Explicitly detect Rosetta translation and set arm64 in those cases.
28 lines
641 B
Bash
28 lines
641 B
Bash
#!/bin/zsh
|
|
|
|
arch_name="$(uname -m)"
|
|
|
|
# When the script is launched from Steam, it'll be run through Rosetta.
|
|
# Manually override arch to arm64 in that case.
|
|
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
|
|
arch_name="arm64"
|
|
fi
|
|
|
|
# Allow users to force Rosetta
|
|
if [[ "$@" =~ \-\-intel ]]; then
|
|
arch_name="x86_64"
|
|
fi
|
|
|
|
# legacy app installation
|
|
if [ -d OBS.app ]; then
|
|
exec open OBS.app -W --args "$@"
|
|
fi
|
|
|
|
if [ "${arch_name}" = "x86_64" ]; then
|
|
exec open x86/OBS.app -W --args "$@"
|
|
elif [ "${arch_name}" = "arm64" ]; then
|
|
exec open arm64/OBS.app -W --args "$@"
|
|
else
|
|
echo "Unknown architecture: ${arch_name}"
|
|
fi
|