2018-03-27 17:18:49 +00:00
|
|
|
#!@bash@/bin/bash
|
|
|
|
export JAVA_HOME="${JAVA_HOME:-@jdk@}"
|
2018-05-02 20:46:01 +00:00
|
|
|
#export SAL_USE_VCLPLUGIN="${SAL_USE_VCLPLUGIN:-gen}"
|
2018-03-27 17:18:49 +00:00
|
|
|
|
2021-04-22 15:18:46 +00:00
|
|
|
if uname | grep Linux > /dev/null &&
|
2018-04-15 06:33:10 +00:00
|
|
|
! ( test -n "$DBUS_SESSION_BUS_ADDRESS" ); then
|
2018-03-27 17:18:49 +00:00
|
|
|
dbus_tmp_dir="/run/user/$(id -u)/libreoffice-dbus"
|
2019-03-23 11:16:02 +00:00
|
|
|
if ! test -d "$dbus_tmp_dir" && test -d "/run"; then
|
|
|
|
mkdir -p "$dbus_tmp_dir"
|
|
|
|
fi
|
|
|
|
if ! test -d "$dbus_tmp_dir"; then
|
|
|
|
dbus_tmp_dir="/tmp/libreoffice-$(id -u)/libreoffice-dbus"
|
|
|
|
mkdir -p "$dbus_tmp_dir"
|
|
|
|
fi
|
2018-03-27 17:18:49 +00:00
|
|
|
dbus_socket_dir="$(mktemp -d -p "$dbus_tmp_dir")"
|
2018-05-02 20:46:01 +00:00
|
|
|
"@dbus@"/bin/dbus-daemon --nopidfile --nofork --config-file "@dbus@"/share/dbus-1/session.conf --address "unix:path=$dbus_socket_dir/session" &> /dev/null &
|
2021-04-22 15:18:46 +00:00
|
|
|
dbus_pid=$!
|
2018-04-15 06:33:10 +00:00
|
|
|
export DBUS_SESSION_BUS_ADDRESS="unix:path=$dbus_socket_dir/session"
|
2018-03-27 17:18:49 +00:00
|
|
|
fi
|
|
|
|
|
2020-02-17 13:50:38 +00:00
|
|
|
for PROFILE in $NIX_PROFILES; do
|
|
|
|
HDIR="$PROFILE/share/hunspell"
|
|
|
|
if [ -d "$HDIR" ]; then
|
|
|
|
export DICPATH=$DICPATH''${DICPATH:+:}$HDIR
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2018-03-27 17:18:49 +00:00
|
|
|
"@libreoffice@/bin/$(basename "$0")" "$@"
|
|
|
|
code="$?"
|
|
|
|
|
2021-04-22 15:18:46 +00:00
|
|
|
test -n "$dbus_socket_dir" && { rm -rf "$dbus_socket_dir"; kill $dbus_pid; }
|
2018-03-27 17:18:49 +00:00
|
|
|
exit "$code"
|