diff --git a/scripts/open-metal-lumbridge.sh b/scripts/open-metal-lumbridge.sh index 708e929..f54c45c 100755 --- a/scripts/open-metal-lumbridge.sh +++ b/scripts/open-metal-lumbridge.sh @@ -17,7 +17,7 @@ export XAUTHORITY=${XAUTHORITY:-/run/user/1000/gdm/Xauthority} export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/1000} export DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS:-unix:path=/run/user/1000/bus} -for command_name in cargo wmctrl xdotool; do +for command_name in wmctrl xdotool; do if ! command -v "$command_name" >/dev/null 2>&1; then echo "required command not found: $command_name" >&2 exit 1 @@ -25,6 +25,22 @@ for command_name in cargo wmctrl xdotool; do done if [[ ! -x "$binary_path" ]]; then + if ! command -v cargo >/dev/null 2>&1; then + # Non-login Tailscale SSH commands do not inherit metal's Cargo PATH. + # shellcheck source=/dev/null + source /home/metal/.cargo/env + fi + if ! command -v cargo >/dev/null 2>&1; then + echo "required command not found: cargo" >&2 + exit 1 + fi + xkb_runtime=/usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0 + if [[ -e "$xkb_runtime" ]]; then + native_libs="$repo_path/spikes/gpui-shell/target/native-libs" + mkdir -p "$native_libs" + ln -sfn "$xkb_runtime" "$native_libs/libxkbcommon-x11.so" + export LIBRARY_PATH="$native_libs${LIBRARY_PATH:+:$LIBRARY_PATH}" + fi cargo build --locked --manifest-path "$manifest_path" fi