summarylogtreecommitdiffstats
path: root/ollama-chat-desktop.sh
diff options
context:
space:
mode:
authorzxp198210052025-01-17 16:40:41 +0800
committerzxp198210052025-01-17 16:40:41 +0800
commite9ed67d9aa801e1701a50a6b5606941962e3f4af (patch)
tree9ac2b5b24519250a8624108b41d1b30a124ce3f9 /ollama-chat-desktop.sh
downloadaur-e9ed67d9aa801e1701a50a6b5606941962e3f4af.tar.gz
update to r7.a997e79
Diffstat (limited to 'ollama-chat-desktop.sh')
-rw-r--r--ollama-chat-desktop.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/ollama-chat-desktop.sh b/ollama-chat-desktop.sh
new file mode 100644
index 000000000000..40e422ca2ee7
--- /dev/null
+++ b/ollama-chat-desktop.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+set -o pipefail
+_APPDIR="/usr/lib/@appname@"
+_RUNNAME="${_APPDIR}/@runname@"
+_CFGDIR="@cfgdirname@/"
+_OPTIONS="@options@"
+export PATH="${_APPDIR}:${PATH}"
+export LD_LIBRARY_PATH="${_APPDIR}/swiftshader:${_APPDIR}/lib:${LD_LIBRARY_PATH}"
+export ELECTRON_IS_DEV=0
+export ELECTRON_FORCE_IS_PACKAGED=true
+export ELECTRON_DISABLE_SECURITY_WARNINGS=true
+export ELECTRON_OVERRIDE_DIST_PATH="/usr/bin/electron@electronversion@"
+export NODE_ENV=production
+export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
+export _FLAGS_FILE="${XDG_CONFIG_HOME}/${_CFGDIR}@appname@-flags.conf"
+declare -a _USER_FLAGS
+if [[ -f "${_FLAGS_FILE}" ]]; then
+ while read -r line; do
+ if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
+ _USER_FLAGS+=("${line}")
+ fi
+ done < "${_FLAGS_FILE}"
+fi
+cd "${_APPDIR}" || { echo "Failed to change directory to ${_APPDIR}"; exit 1; }
+if [[ "${EUID}" -ne 0 ]] || [[ "${ELECTRON_RUN_AS_NODE}" ]]; then
+ exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} "${_USER_FLAGS[@]}" "$@"
+else
+ exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} --no-sandbox "${_USER_FLAGS[@]}" "$@"
+fi \ No newline at end of file