<commit_before>#!@bash@/bin/bash
export JAVA_HOME="${JAVA_HOME:-@jdk@}"
export SAL_USE_VCLPLUGIN="${SAL_USE_VCLPLUGIN:-gen}"

if uname | grep Linux > /dev/null && 
       ! ( test -n "$DBUS_SESSION_BUS_ADDRESS" && 
         test -n "$DBUS_SYSTEM_BUS_ADDRESS" ); then
    dbus_tmp_dir="/run/user/$(id -u)/libreoffice-dbus"
    mkdir "$dbus_tmp_dir"
    dbus_socket_dir="$(mktemp -d -p "$dbus_tmp_dir")"
    cat "@dbus@/share/dbus-1/system.conf" |
        grep -v '[<]user[>]messagebus' > "$dbus_socket_dir/system.conf"
    if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
        "@dbus@"/bin/dbus-daemon --nopidfile --nofork --config-file "@dbus@"/share/dbus-1/session.conf --address "unix:path=$dbus_socket_dir/session"  >&2 &
        export DBUS_SESSION_BUS_ADDRESS="unix:path=$dbus_socket_dir/session"
    fi
    if test -z "$DBUS_SYSTEM_BUS_ADDRESS"; then
        "@dbus@"/bin/dbus-daemon --nopidfile --nofork --config-file "$dbus_socket_dir/system.conf" --address "unix:path=$dbus_socket_dir/system" >&2 &
        export DBUS_SYSTEM_BUS_ADDRESS="unix:path=$dbus_socket_dir/system"
    fi
fi

"@libreoffice@/bin/$(basename "$0")" "$@"
code="$?"

test -n "$dbus_socket_dir" && rm -rf "$dbus_socket_dir"
exit "$code"<commit_msg>libreoffice: wrapper: apparently session bus for DBus is enough, and adding a local system bus when a session bus is present makes things worse<commit_after>#!@bash@/bin/bash
export JAVA_HOME="${JAVA_HOME:-@jdk@}"
export SAL_USE_VCLPLUGIN="${SAL_USE_VCLPLUGIN:-gen}"

if uname | grep Linux > /dev/null && 
       ! ( test -n "$DBUS_SESSION_BUS_ADDRESS" ); then
    dbus_tmp_dir="/run/user/$(id -u)/libreoffice-dbus"
    mkdir "$dbus_tmp_dir"
    dbus_socket_dir="$(mktemp -d -p "$dbus_tmp_dir")"
    "@dbus@"/bin/dbus-daemon --nopidfile --nofork --config-file "@dbus@"/share/dbus-1/session.conf --address "unix:path=$dbus_socket_dir/session"  >&2 &
    export DBUS_SESSION_BUS_ADDRESS="unix:path=$dbus_socket_dir/session"
fi

"@libreoffice@/bin/$(basename "$0")" "$@"
code="$?"

test -n "$dbus_socket_dir" && rm -rf "$dbus_socket_dir"
exit "$code"
{'fraction_non_alphanumeric': 0.17607332368547998, 'fraction_numerical': 0.003859141341051616, 'mean_word_length': 4.290816326530612, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2882715', 'n_tokens_mistral': 850, 'n_tokens_neox': 813, 'n_words': 141}