Menu

#868 Please, fix SAL_USE_VCLPLUGIN in startlxde

open
nobody
5
2019-11-02
2017-04-10
No

When both GTK+2 and GTK+3 installed there's a problem with theming -- with SAL_USE_VCLPLUGIN=gtk manually set LibreOffice uses unthemed GTK+2, while the main toolkit in the system is GTK+3.
Since LibreOffice (and perhaps OpenOffice too) automatically detects toolkit libraries in the order gtk3 -> gtk -> kde4 -> generic, I think it would be ok to remove this variable at all (startlxde.in.diff.2) or to obey system-wide settings (startlxde.in.diff.1)


lxde-common-0.99.2

2 Attachments

Discussion

  • Lonely Stranger

    Lonely Stranger - 2017-04-17

    Thank you for a report. Could you clarify your suggestion more, please? It's not clear from your patches. Do you suggest to eliminate 'export SAL_USE_VCLPLUGIN=gtk' line?

     
  • Vladimir Valeyev

    I think it would be better to remove the line. I'm not sure about OpenOffice, but recent versions of LibreOffice are fine without SAL_USE_VCLPLUGIN environment variable. I have tested with LibreOffice versions 5.2.6.2 and 5.3.1.2 -- both of them correctly detect graphical toolkit (with the variable unset).

    The startlxde.in.diff.1 patch is an alternative method to keep SAL_USE_VCLPLUGIN variable, perhaps, for compatibility with older versions of Open/LibreOffice that do not automatically detect toolkit libraries. But I think it's not necessary any more.

     

    Last edit: Vladimir Valeyev 2017-04-26
  • Loye Young

    Loye Young - 2018-05-23

    Here's a rewrite of startlxde that will fix this issue and others, because it uses a user configuration file.

    =========== UPDATE =================
    Code below updated from original post. Separated configuration files openbox/environment and openbox/lxde-environment, with a few other minor corrections.

    Consideration might also be given to using this script for creating a default $HOME/.config/lxsession/LXDE/desktop.conf if it does not already exist, and populating with intelligent guesses based on what is installed on the system.
    =========== / UPDATE =================

    #!/bin/sh
    
    # startlxde
    # This was rewritten by Loye Young <loye.young@iycc.net> 
    # based on the original by Hong Jen Yee.
    #
    
    LOGFILE="$HOME/.startlxde.log"
    echo > "$LOGFILE"
    cat <<EOF >> "$LOGFILE"
    $(date) START startlxde
    EOF
    
    # Set local system-wide configuration variables in $OPENBOX_SYSTEM_CONF_FILE
    # Set user configuration overrides in $OPENBOX_USER_CONF_FILE, using syntax of:
    ## export NAME="value"
    
    # =================== Default variables =======================================
    
    ## System settings -- You probably do not need to change these
    OPENBOX_SYSTEM_CONF_DIR="/etc/xdg/openbox"
    OPENBOX_SYSTEM_CONF_FILE="$OPENBOX_SYSTEM_CONF_DIR/environment"
    OPENBOX_LXDE_SYSTEM_CONF_FILE="$OPENBOX_SYSTEM_CONF_DIR/LXDE/rc.xml"
    XDG_SYSTEM_USER_DIR_DEFAULT_FILE="/etc/xdg/user-dirs.defaults"
    ## User settings -- You probably do not need to change these, either.
    export XDG_DESKTOP_DIR="$HOME/Desktop"
    export XDG_CONFIG_HOME="$HOME/.config"
    export XDG_USER_DIRS="$XDG_CONFIG_HOME/user-dirs.dirs"
    export XDG_DATA_HOME="$HOME/.local/share"
    export XDG_MENU_PREFIX="lxde-"
    export XDG_CURRENT_DESKTOP="LXDE"
    export USER_APPS_DIR="$XDG_DATA_HOME/applications"
    export OPENBOX_USER_CONF_DIR="$XDG_CONFIG_HOME/openbox"
    export OPENBOX_USER_CONF_FILE="$OPENBOX_USER_CONF_DIR/environment"
    export OPENBOX_LXDE_USER_ENVIRONMENT_FILE="$OPENBOX_USER_CONF_DIR/lxde-environment"
    export OPENBOX_LXDE_USER_CONF_FILE="$OPENBOX_USER_CONF_DIR/lxde-rc.xml"
    
    # SAL_USE_VCLPLUGIN might be something you want to tweak
    # To force the use of a certain VCL UI interface, use one of:
    ## SAL_USE_VCLPLUGIN=gen
    ## SAL_USE_VCLPLUGIN=kde4
    ## SAL_USE_VCLPLUGIN=gtk
    ## SAL_USE_VCLPLUGIN=gtk3
    # Enable GTK3 integration for OpenOffice.org / LibreOffice, if available.
    export SAL_USE_VCLPLUGIN="gtk3"
    
    # =================== Default environment file =======================================
    # If no OPENBOX_USER_CONF_FILE, create one.
    if [ ! -f "$OPENBOX_USER_CONF_FILE" ] ; then
        if [ -f "$OPENBOX_SYSTEM_CONF_FILE" ] ; then
            cp "$OPENBOX_SYSTEM_CONF_FILE" "$OPENBOX_USER_CONF_FILE"
        fi
    fi
    
    # Tell OPENBOX_USER_CONF_FILE to source the OPENBOX_LXDE_USER_ENVIRONMENT_FILE
    if ! grep -q "source $OPENBOX_LXDE_USER_ENVIRONMENT_FILE" "$OPENBOX_USER_CONF_FILE" ; then
        echo "source $OPENBOX_LXDE_USER_ENVIRONMENT_FILE" >> "$OPENBOX_USER_CONF_FILE"
    fi
    
    # If no OPENBOX_LXDE_USER_ENVIRONMENT_FILE, create and populate it.
    if [ ! -f "$OPENBOX_LXDE_USER_ENVIRONMENT_FILE" ] ; then
        cat <<EOF >> "$OPENBOX_LXDE_USER_ENVIRONMENT_FILE"
    # The following were automatically populated by /usr/bin/startlxde
    
    ## System settings -- You probably do not need to change these
    OPENBOX_SYSTEM_CONF_DIR="/etc/xdg/openbox"
    OPENBOX_SYSTEM_CONF_FILE="/etc/xdg/openbox/environment"
    OPENBOX_LXDE_SYSTEM_CONF_FILE="$OPENBOX_SYSTEM_CONF_DIR/LXDE/rc.xml"
    XDG_SYSTEM_USER_DIR_DEFAULT_FILE="/etc/xdg/user-dirs.defaults"
    ## User settings -- You probably do not need to change these, either.
    export XDG_DESKTOP_DIR="$HOME/Desktop"
    export XDG_CONFIG_HOME="$HOME/.config"
    export XDG_USER_DIRS="$XDG_CONFIG_HOME/user-dirs.dirs"
    export XDG_DATA_HOME="$HOME/.local/share"
    export XDG_MENU_PREFIX="lxde-"
    export XDG_CURRENT_DESKTOP="LXDE"
    export USER_APPS_DIR="$XDG_DATA_HOME/applications"
    export OPENBOX_USER_CONF_DIR="$XDG_CONFIG_HOME/openbox"
    export OPENBOX_USER_CONF_FILE="$OPENBOX_USER_CONF_DIR/environment"
    export OPENBOX_LXDE_USER_ENVIRONMENT_FILE="$OPENBOX_USER_CONF_DIR/lxde-environment"
    export OPENBOX_LXDE_USER_CONF_FILE="$OPENBOX_USER_CONF_DIR/lxde-rc.xml"
    # SAL_USE_VCLPLUGIN might be something you want to tweak
    # To force the use of a certain VCL UI interface, use one of:
    ## SAL_USE_VCLPLUGIN=gen
    ## SAL_USE_VCLPLUGIN=kde4
    ## SAL_USE_VCLPLUGIN=gtk
    ## SAL_USE_VCLPLUGIN=gtk3
    # Enable GTK3 integration for OpenOffice.org / LibreOffice, if available.
    export SAL_USE_VCLPLUGIN="gtk3"
    EOF
    
    fi
    
    #--------------- Logging -----------------------------------
    echo "$(date) This tests the variables in the environment file. Nothing done yet." >> "$LOGFILE"
    cat "$OPENBOX_LXDE_USER_ENVIRONMENT_FILE" >> "$LOGFILE"
    #--------------- /Logging -----------------------------------
    
    # =================== WORK =======================================
    
    # Ensure the existence of the directories mentioned above
    mkdir -p \
        "$XDG_CONFIG_HOME" \
        "$XDG_DATA_HOME" \
        "$OPENBOX_USER_CONF_DIR" \
        "$USER_APPS_DIR"
    
    # If user's user-dir.dirs file does not exist, create it
    if [ ! -f "$XDG_USER_DIRS" ]; then
        if [ -f "$XDG_SYSTEM_USER_DIR_DEFAULT_FILE" ]; then
            source "$XDG_SYSTEM_USER_DIR_DEFAULT_FILE"
    
    #--------------- Logging -----------------------------------
            echo -e "\n$(date) $XDG_SYSTEM_USER_DIR_DEFAULT_FILE says the following:" >> "$LOGFILE"
            cat "$XDG_SYSTEM_USER_DIR_DEFAULT_FILE" >> "$LOGFILE"
    #--------------- / Logging -----------------------------------
    
            touch "$XDG_USER_DIRS"
    # Populate "$XDG_USER_DIRS"
            cat <<EOF > "$XDG_USER_DIRS"
    XDG_DESKTOP_DIR="$HOME/$DESKTOP"
    XDG_DOWNLOAD_DIR="$HOME/$DOWNLOADS"
    XDG_TEMPLATES_DIR="$HOME/$TEMPLATES"
    XDG_PUBLICSHARE_DIR="$HOME/$PUBLIC"
    XDG_DOCUMENTS_DIR="$HOME/$DOCUMENTS"
    XDG_MUSIC_DIR="$HOME/$MUSIC"
    XDG_PICTURES_DIR="$HOME/$PICTURES"
    XDG_VIDEOS_DIR="$HOME/$VIDEOS"
    EOF
        fi
    fi
    #--------------- Logging -----------------------------------
    echo -e "\n$(date) Contents of $XDG_USER_DIRS :" >> "$LOGFILE"
    cat "$XDG_USER_DIRS" >> "$LOGFILE"
    #--------------- / Logging -----------------------------------
    
    # Source the user dirs
    source "$XDG_USER_DIRS"
    
    # Ensure user dirs exist
    mkdir -p \
        "$XDG_DESKTOP_DIR" \
        "$XDG_DOWNLOAD_DIR" \
        "$XDG_TEMPLATES_DIR" \
        "$XDG_PUBLICSHARE_DIR" \
        "$XDG_DOCUMENTS_DIR" \
        "$XDG_MUSIC_DIR" \
        "$XDG_PICTURES_DIR" \
        "$XDG_VIDEOS_DIR"
    
    #--------------- Logging -----------------------------------
    echo -e "\n$(date) USER DIRS created" >> "$LOGFILE"
    #--------------- / Logging -----------------------------------
    
    # Source user configuration overrides.
    # Note: If the user configuration override did not exist,
    #       we fixed that in the "Default configuration file" section,
    #       so we can reliably source it here. But even if it does not
    #       exist, we already set the default variables, so no harm
    #       is done.
    if [ -f "$OPENBOX_USER_CONF_FILE" ] ; then
        source "$OPENBOX_USER_CONF_FILE"
    fi
    
    #--------------- Logging -----------------------------------
    echo -e "\n$(date) Contents of $OPENBOX_USER_CONF_FILE" >> "$LOGFILE"
    cat "$OPENBOX_USER_CONF_FILE" >> "$LOGFILE"
    echo -e "\n$(date) Contents of $OPENBOX_LXDE_USER_ENVIRONMENT_FILE" >> "$LOGFILE"
    cat "$OPENBOX_LXDE_USER_ENVIRONMENT_FILE" >> "$LOGFILE"
    #--------------- / Logging -----------------------------------
    
    # Ensure the existence of openbox config file
    if [ ! -f "$OPENBOX_LXDE_USER_CONF_FILE" ] ; then
        cp "$OPENBOX_LXDE_SYSTEM_CONF_FILE" "$OPENBOX_LXDE_USER_CONF_FILE"
    fi
    
    #--------------- Logging -----------------------------------
    if [ -f "$OPENBOX_LXDE_USER_CONF_FILE" ] ; then
        echo -e "\n$(date) $OPENBOX_LXDE_USER_CONF_FILE exists" >> "$LOGFILE"
    else
        echo -e "\n$(date) No buedo: $OPENBOX_LXDE_USER_CONF_FILE" >> "$LOGFILE"
    fi
    echo -e "Next is clean up of GDM, using xprop. If error message, maybe it does not work. . . ." >> "$LOGFILE"
    #--------------- / Logging -----------------------------------
    
    # Clean up after GDM (GDM sets the number of desktops to one)
    # Does this still work?
    xprop -root -remove _NET_NUMBER_OF_DESKTOPS -remove _NET_DESKTOP_NAMES -remove _NET_CURRENT_DESKTOP 2>> "$LOGFILE"
    
    # Launch DBus if needed
    if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
        if test -z "$XDG_RUNTIME_DIR" -o ! -S "$XDG_RUNTIME_DIR/bus" -o ! -O "$XDG_RUNTIME_DIR/bus"; then
            eval "$(dbus-launch --sh-syntax --exit-with-session)"
        fi
    fi
    
    #--------------- Logging -----------------------------------
    echo "Jiggy which debus-launch voodoo did or did not do something" >> "$LOGFILE"
    echo "Now starting LXDE session. Good luck everybody." >> "$LOGFILE"
    #--------------- / Logging -----------------------------------
    
    # Start the LXDE session
    exec /usr/bin/lxsession -s "$XDG_CURRENT_DESKTOP" -e "$XDG_CURRENT_DESKTOP"
    
     

    Last edit: Loye Young 2018-05-24
  • Sebastiaan Lokhorst

    Please remove the 'export SAL_USE_VCLPLUGIN=gtk' line. GTK+2 support was removed in LibreOffice 6.4, released on 29 January 2020. commit

     

    Last edit: Sebastiaan Lokhorst 2020-01-29

Log in to post a comment.

MongoDB Logo MongoDB