git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit3616b52e20c218e3110790639e135b3a80046d47 authorThomas Tuegel <ttuegel@gmail.com> dateFri 26 Aug 2016, 08:40 (10 years ago) parenta0aa333
1 file changed+22−22
pkgs/desktops/kde-5/plasma/startkde/startkde.sh+22−22
pkgs/desktops/kde-5/plasma/startkde/startkde.sh+22−22
@@ -185,28 +185,6 @@ if test -z "$dl"; then
185185 esac
186186fi
187187
188−# Source scripts found in <config locations>/plasma-workspace/env/*.sh
189−# (where <config locations> correspond to the system and user's configuration
190−# directories, as identified by Qt's qtpaths, e.g. $HOME/.config
191−# and /etc/xdg/ on Linux)
192−#
193−# This is where you can define environment variables that will be available to
194−# all KDE programs, so this is where you can run agents using e.g. eval `ssh-agent`
195−# or eval `gpg-agent --daemon`.
196−# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script
197−#
198−# (see end of this file).
199−# For anything else (that doesn't set env vars, or that needs a window manager),
200−# better use the Autostart folder.
201−
202−IFS=":" read -r -a scriptpath <<< $(qtpaths --paths GenericConfigLocation)
203−# Add /env/ to the directory to locate the scripts to be sourced
204−for prefix in "${scriptpath[@]}"; do
205− for file in "$prefix"/plasma-workspace/env/*.sh; do
206− test -r "$file" && . "$file" || true
207− done
208−done
209−
210188echo 'startkde: Starting up...' 1>&2
211189
212190# Make sure that D-Bus is running
@@ -255,6 +233,28 @@ export KDE_SESSION_UID
255233XDG_CURRENT_DESKTOP=KDE
256234export XDG_CURRENT_DESKTOP
257235
236+# Source scripts found in <config locations>/plasma-workspace/env/*.sh
237+# (where <config locations> correspond to the system and user's configuration
238+# directories, as identified by Qt's qtpaths, e.g. $HOME/.config
239+# and /etc/xdg/ on Linux)
240+#
241+# This is where you can define environment variables that will be available to
242+# all KDE programs, so this is where you can run agents using e.g. eval `ssh-agent`
243+# or eval `gpg-agent --daemon`.
244+# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script
245+#
246+# (see end of this file).
247+# For anything else (that doesn't set env vars, or that needs a window manager),
248+# better use the Autostart folder.
249+
250+IFS=":" read -r -a scriptpath <<< $(qtpaths --paths GenericConfigLocation)
251+# Add /env/ to the directory to locate the scripts to be sourced
252+for prefix in "${scriptpath[@]}"; do
253+ for file in "$prefix"/plasma-workspace/env/*.sh; do
254+ test -r "$file" && . "$file" || true
255+ done
256+done
257+
258258# At this point all the environment is ready, let's send it to kwalletd if running
259259if test -n "$PAM_KWALLET_LOGIN" ; then
260260 env | socat STDIN UNIX-CONNECT:$PAM_KWALLET_LOGIN