Reorganize dbus a bit more, explicitly update activation env

This commit is contained in:
Salt 2020-07-21 12:15:49 -05:00
parent e9bc4482a1
commit 58236232cc

View File

@ -158,40 +158,7 @@ step_preexecute() {
[ -n "$FIRESTARTER" ] && [ "$FIRESTARTER_DISPLAY" == "$DISPLAY" ] error "Firestarter is already running on $DISPLAY: $FIRESTARTER" 55
export FIRESTARTER="$BASHPID"
export FIRESTARTER_DISPLAY="$DISPLAY"
# IME settings
if has uim; then
export GTK_IM_MODULE='uim'
export QT_IM_MODULE='uim'
export XMODIFIERS='@im=uim'
elif has ibus; then
export GTK_IM_MODULE='ibus'
export QT_IM_MODULE='ibus'
export XMODIFIERS='@im=ibus'
fi
# kcminit/Qt settings
if has qt5ct; then
log "Initializing qt5ct"
if [ -z "$QT_QPA_PLATFORMTHEME" ]; then
export QT_QPA_PLATFORMTHEME="qt5ct"
log "Exporting QT_QPA_PLATFORMTHEME as \"$QT_QPA_PLATFORMTHEME\"" 2
else
log "Using existing theme setting \"$QT_QPA_PLATFORMTHEME\"" 2
fi
if [ -z "$QT_AUTO_SCREEN_SCALE_FACTOR" ]; then
export QT_AUTO_SCREEN_SCALE_FACTOR="0"
log "Exporting QT_AUTO_SCREEN_SCALE_FACTOR as \"$QT_AUTO_SCREEN_SCALE_FACTOR\"" 2
else
log "Using existing scale factor \"$QT_AUTO_SCREEN_SCALE_FACTOR\"" 2
fi
fi
if has kcminit; then
log "Initializing KDE Control Module settings"
kcminit >/dev/null 2>&1
# Disabled here because an XDGCD of KDE implies kded and other KDE parts, breaking copypasta and other things
#export XDG_CURRENT_DESKTOP="KDE"
fi
# dbus
# We initialize this after setting envvars so it propogates to the whole session
if \
[ -z "$DBUS_SESSION_BUS_ADDRESS" ] && \
[ -n "$XDG_RUNTIME_DIR" ] && \
@ -209,6 +176,48 @@ step_preexecute() {
else
warn "Did not start dbus; some applications may misbehave"
fi
# Nest protection
if [ -n "$_hasdbus" ]; then
dbus-update-activation-environment FIRESTARTER FIRESTARTER_DISPLAY
fi
# IME settings
if has uim; then
export GTK_IM_MODULE='uim'
export QT_IM_MODULE='uim'
export XMODIFIERS='@im=uim'
elif has ibus; then
export GTK_IM_MODULE='ibus'
export QT_IM_MODULE='ibus'
export XMODIFIERS='@im=ibus'
fi
if [ -n "$_hasdbus" ]; then
dbus-update-activation-environment GTK_IM_MODULE QT_IM_MODULE XMODIFIERS
fi
# kcminit/Qt settings
if has qt5ct; then
log "Initializing qt5ct"
if [ -z "$QT_QPA_PLATFORMTHEME" ]; then
export QT_QPA_PLATFORMTHEME="qt5ct"
log "Exporting QT_QPA_PLATFORMTHEME as \"$QT_QPA_PLATFORMTHEME\"" 2
else
log "Using existing theme setting \"$QT_QPA_PLATFORMTHEME\"" 2
fi
if [ -z "$QT_AUTO_SCREEN_SCALE_FACTOR" ]; then
export QT_AUTO_SCREEN_SCALE_FACTOR="0"
log "Exporting QT_AUTO_SCREEN_SCALE_FACTOR as \"$QT_AUTO_SCREEN_SCALE_FACTOR\"" 2
else
log "Using existing scale factor \"$QT_AUTO_SCREEN_SCALE_FACTOR\"" 2
fi
if [ -n "$_hasdbus" ]; then
dbus-update-activation-environment QT_QPA_PLATFORMTHEME QT_AUTO_SCREEN_SCALE_FACTOR
fi
fi
if has kcminit; then
log "Initializing KDE Control Module settings"
kcminit >/dev/null 2>&1
# Disabled here because an XDGCD of KDE implies kded and other KDE parts, breaking copypasta and other things
#export XDG_CURRENT_DESKTOP="KDE"
fi
# xhost
if has xhost; then
if xhost +si:localuser:"$(id -un)" >/dev/null 2>&1; then