2018-03-27 19:18:49 +02:00
|
|
|
#!@bash@/bin/bash
|
|
|
|
export JAVA_HOME="${JAVA_HOME:-@jdk@}"
|
2018-05-02 22:46:01 +02:00
|
|
|
#export SAL_USE_VCLPLUGIN="${SAL_USE_VCLPLUGIN:-gen}"
|
2018-03-27 19:18:49 +02:00
|
|
|
|
2021-04-22 17:18:46 +02:00
|
|
|
if uname | grep Linux > /dev/null &&
|
2018-04-15 08:33:10 +02:00
|
|
|
! ( test -n "$DBUS_SESSION_BUS_ADDRESS" ); then
|
2018-03-27 19:18:49 +02:00
|
|
|
dbus_tmp_dir="/run/user/$(id -u)/libreoffice-dbus"
|
2019-03-23 12:16:02 +01: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 19:18:49 +02:00
|
|
|
dbus_socket_dir="$(mktemp -d -p "$dbus_tmp_dir")"
|
2018-05-02 22:46:01 +02: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 17:18:46 +02:00
|
|
|
dbus_pid=$!
|
2018-04-15 08:33:10 +02:00
|
|
|
export DBUS_SESSION_BUS_ADDRESS="unix:path=$dbus_socket_dir/session"
|
2018-03-27 19:18:49 +02:00
|
|
|
fi
|
|
|
|
|
2020-02-17 14:50:38 +01: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 19:18:49 +02:00
|
|
|
"@libreoffice@/bin/$(basename "$0")" "$@"
|
|
|
|
code="$?"
|
|
|
|
|
2021-04-22 17:18:46 +02:00
|
|
|
test -n "$dbus_socket_dir" && { rm -rf "$dbus_socket_dir"; kill $dbus_pid; }
|
2018-03-27 19:18:49 +02:00
|
|
|
exit "$code"
|