Repository navigation
Expand file tree
/
Copy pathAppRun
More file actions
executable file
·45 lines (41 loc) · 1.62 KB
/
Copy pathAppRun
File metadata and controls
executable file
·45 lines (41 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/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 or a .orx file (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:* | *.orx) link=("$arg"); break ;;
esac
done
shopt -u nocasematch
exec "$APPDIR/usr/bin/orx" app "${link[@]}"