mirror of
https://github.com/alphaXiv/OpenResearch.git
synced 2026-10-30 07:53:33 +08:00
* Open openresearch:// links in the Windows and Linux apps Re-lands #798, which merged into #797's branch after #797 had already merged to main, so it never shipped. Applied onto current main; the one conflict (UserEvent, against #822's menu events) keeps both sides. Also lints the launcher's tests in CI and documents link handling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Update the workflow test for the launcher's clippy and test steps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
46 lines
1.6 KiB
Bash
Executable File
46 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# The AppImage's entry point: start the bundled orx as the desktop app (see
|
|
# src/commands/app.rs). Only an openresearch: link (the desktop entry's %u) is
|
|
# passed on; the CLI is `orx`, not this.
|
|
set -e
|
|
|
|
export APPDIR="${APPDIR:-"$(dirname "$(realpath "$0")")"}"
|
|
|
|
# The session's values of what this script and the hook below override, as
|
|
# `=<value>` or `-` for unset, so orx can hand them back to the host programs it
|
|
# opens (shell_env::host_gui_env; keep the two lists in step).
|
|
for var in GDK_BACKEND GDK_PIXBUF_MODULE_FILE GI_TYPELIB_PATH GIO_EXTRA_MODULES \
|
|
GIO_MODULE_DIR GSETTINGS_SCHEMA_DIR GTK_DATA_PREFIX GTK_EXE_PREFIX GTK_IM_MODULE_FILE GTK_PATH \
|
|
GTK_THEME XDG_DATA_DIRS; do
|
|
if [ -n "${!var+set}" ]; then
|
|
export "ORX_HOST_$var==${!var}"
|
|
else
|
|
export "ORX_HOST_$var=-"
|
|
fi
|
|
done
|
|
|
|
# linuxdeploy-plugin-gtk's hook points GTK at the bundled modules and schemas.
|
|
for hook in "$APPDIR"/apprun-hooks/*.sh; do
|
|
if [ -e "$hook" ]; then
|
|
# shellcheck disable=SC1090
|
|
. "$hook"
|
|
fi
|
|
done
|
|
# Only the bundled GIO modules (TLS): the host's need a newer GLib than the image's.
|
|
export GIO_MODULE_DIR="$APPDIR/usr/lib/gio/modules"
|
|
unset GIO_EXTRA_MODULES
|
|
|
|
# scripts/build-linux-appimage.sh rewrote libwebkit2gtk's /usr paths to ././,
|
|
# so WebKit finds its bundled helper processes relative to this directory.
|
|
cd "$APPDIR/usr"
|
|
link=()
|
|
# Any position: AppImage integrators keep the bundled entry's `app` before %u.
|
|
shopt -s nocasematch
|
|
for arg in "$@"; do
|
|
case "$arg" in
|
|
openresearch:*) link=("$arg"); break ;;
|
|
esac
|
|
done
|
|
shopt -u nocasematch
|
|
exec "$APPDIR/usr/bin/orx" app "${link[@]}"
|