From 3616b52e20c218e3110790639e135b3a80046d47 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 26 Aug 2016 08:40:30 -0500 Subject: [PATCH] kde5.startkde: initialize session variables before loading user env The desktop session variables need to be initialized before loading the user environment scripts so that these scripts can exec programs that rely on the session variables. For example, these variables must be set when gpg-agent is started or pinentry-qt will not respect the user's theme settings. --- .../kde-5/plasma/startkde/startkde.sh | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/pkgs/desktops/kde-5/plasma/startkde/startkde.sh b/pkgs/desktops/kde-5/plasma/startkde/startkde.sh index a39b388cbb7..256f9949e83 100755 --- a/pkgs/desktops/kde-5/plasma/startkde/startkde.sh +++ b/pkgs/desktops/kde-5/plasma/startkde/startkde.sh @@ -185,28 +185,6 @@ if test -z "$dl"; then esac fi -# Source scripts found in /plasma-workspace/env/*.sh -# (where correspond to the system and user's configuration -# directories, as identified by Qt's qtpaths, e.g. $HOME/.config -# and /etc/xdg/ on Linux) -# -# This is where you can define environment variables that will be available to -# all KDE programs, so this is where you can run agents using e.g. eval `ssh-agent` -# or eval `gpg-agent --daemon`. -# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script -# -# (see end of this file). -# For anything else (that doesn't set env vars, or that needs a window manager), -# better use the Autostart folder. - -IFS=":" read -r -a scriptpath <<< $(qtpaths --paths GenericConfigLocation) -# Add /env/ to the directory to locate the scripts to be sourced -for prefix in "${scriptpath[@]}"; do - for file in "$prefix"/plasma-workspace/env/*.sh; do - test -r "$file" && . "$file" || true - done -done - echo 'startkde: Starting up...' 1>&2 # Make sure that D-Bus is running @@ -255,6 +233,28 @@ export KDE_SESSION_UID XDG_CURRENT_DESKTOP=KDE export XDG_CURRENT_DESKTOP +# Source scripts found in /plasma-workspace/env/*.sh +# (where correspond to the system and user's configuration +# directories, as identified by Qt's qtpaths, e.g. $HOME/.config +# and /etc/xdg/ on Linux) +# +# This is where you can define environment variables that will be available to +# all KDE programs, so this is where you can run agents using e.g. eval `ssh-agent` +# or eval `gpg-agent --daemon`. +# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script +# +# (see end of this file). +# For anything else (that doesn't set env vars, or that needs a window manager), +# better use the Autostart folder. + +IFS=":" read -r -a scriptpath <<< $(qtpaths --paths GenericConfigLocation) +# Add /env/ to the directory to locate the scripts to be sourced +for prefix in "${scriptpath[@]}"; do + for file in "$prefix"/plasma-workspace/env/*.sh; do + test -r "$file" && . "$file" || true + done +done + # At this point all the environment is ready, let's send it to kwalletd if running if test -n "$PAM_KWALLET_LOGIN" ; then env | socat STDIN UNIX-CONNECT:$PAM_KWALLET_LOGIN