Reorganize dbus a bit more, explicitly update activation env
This commit is contained in:
		
							
								
								
									
										75
									
								
								firestarter
									
									
									
									
									
								
							
							
						
						
									
										75
									
								
								firestarter
									
									
									
									
									
								
							@@ -158,40 +158,7 @@ step_preexecute() {
 | 
				
			|||||||
	[ -n "$FIRESTARTER" ] && [ "$FIRESTARTER_DISPLAY" == "$DISPLAY" ] error "Firestarter is already running on $DISPLAY: $FIRESTARTER" 55
 | 
						[ -n "$FIRESTARTER" ] && [ "$FIRESTARTER_DISPLAY" == "$DISPLAY" ] error "Firestarter is already running on $DISPLAY: $FIRESTARTER" 55
 | 
				
			||||||
	export FIRESTARTER="$BASHPID"
 | 
						export FIRESTARTER="$BASHPID"
 | 
				
			||||||
	export FIRESTARTER_DISPLAY="$DISPLAY"
 | 
						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
 | 
						# dbus
 | 
				
			||||||
	# We initialize this after setting envvars so it propogates to the whole session
 | 
					 | 
				
			||||||
	if \
 | 
						if \
 | 
				
			||||||
		[ -z "$DBUS_SESSION_BUS_ADDRESS" ] && \
 | 
							[ -z "$DBUS_SESSION_BUS_ADDRESS" ] && \
 | 
				
			||||||
		[ -n "$XDG_RUNTIME_DIR" ] && \
 | 
							[ -n "$XDG_RUNTIME_DIR" ] && \
 | 
				
			||||||
@@ -209,6 +176,48 @@ step_preexecute() {
 | 
				
			|||||||
	else
 | 
						else
 | 
				
			||||||
		warn "Did not start dbus; some applications may misbehave"
 | 
							warn "Did not start dbus; some applications may misbehave"
 | 
				
			||||||
	fi
 | 
						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
 | 
						# xhost
 | 
				
			||||||
	if has xhost; then
 | 
						if has xhost; then
 | 
				
			||||||
		if xhost +si:localuser:"$(id -un)" >/dev/null 2>&1; then
 | 
							if xhost +si:localuser:"$(id -un)" >/dev/null 2>&1; then
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user