From ac4b08b15c236a1a463e079fa77ccf8daea1e482 Mon Sep 17 00:00:00 2001 From: Rudd-O Date: Wed, 23 Feb 2022 18:00:24 +0000 Subject: [PATCH 1/2] Make qubes-session inherit the systemd user session variables. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The standard environment.d facility is currently not respected in Qubes OS 4.1. This leads to inability to define environment variables when starting apps via qrexec¹. This should be fixed. Here is the fix — it is a fix that will not have any substantial performance impact (it runs *once*), and uses documented APIs to execute on the fix. ¹ Technically there's `/etc/profile.d` but that's meant to be used for **shells**. There is no guarantee that apps started via qrexec will inherit these variables. --- appvm-scripts/usrbin/qubes-session | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/appvm-scripts/usrbin/qubes-session b/appvm-scripts/usrbin/qubes-session index 6d9ed92e..6fe89216 100755 --- a/appvm-scripts/usrbin/qubes-session +++ b/appvm-scripts/usrbin/qubes-session @@ -27,6 +27,14 @@ loginctl activate "$XDG_SESSION_ID" +# Now import the environment from the systemd user session. +# This is necessary to enable users to configure their +# Qubes environment using the standard environment.d +# facility. Documentation for the facility is at: +# https://www.freedesktop.org/software/systemd/man/environment.d.html +eval `systemctl --user show-environment | sed 's/^/export /'` + + if qsvc guivm-gui-agent; then if [ -e "$HOME/.xinitrc" ]; then . "$HOME/.xinitrc" From d9f648f0372dcf453bb19485ced869ff68ab7ef4 Mon Sep 17 00:00:00 2001 From: Rudd-O Date: Fri, 4 Mar 2022 12:28:46 +0000 Subject: [PATCH 2/2] Update qubes-session --- appvm-scripts/usrbin/qubes-session | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appvm-scripts/usrbin/qubes-session b/appvm-scripts/usrbin/qubes-session index 6fe89216..11f95f24 100755 --- a/appvm-scripts/usrbin/qubes-session +++ b/appvm-scripts/usrbin/qubes-session @@ -32,7 +32,7 @@ loginctl activate "$XDG_SESSION_ID" # Qubes environment using the standard environment.d # facility. Documentation for the facility is at: # https://www.freedesktop.org/software/systemd/man/environment.d.html -eval `systemctl --user show-environment | sed 's/^/export /'` +eval $(systemctl --user show-environment | sed 's/^/export /') if qsvc guivm-gui-agent; then