gui-apps/sway-services: add 0002-sway-user-service-fix-deprecated-import-environment-.patch

master
Alexander Miroshnichenko 2022-11-22 10:55:28 +03:00
parent ee7ada7328
commit eda513f24d
Signed by: alex
GPG Key ID: E93720C6C73A77F4
1 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,38 @@
From 88a319ec7c49589530ee36c810cd699a4e8270ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Venri=C3=A8s?= <thomas.venries@gmail.com>
Date: Wed, 21 Sep 2022 12:37:30 +0200
Subject: [PATCH] sway-user-service: fix deprecated import-environment without
variable
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Fixes #25
Signed-off-by: Alexander Miroshnichenko <alex@millerson.name>
---
bin/sway-user-service | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/bin/sway-user-service b/bin/sway-user-service
index 946a91e17a60..647e1344d972 100755
--- a/bin/sway-user-service
+++ b/bin/sway-user-service
@@ -22,10 +22,13 @@ source /etc/profile
export XDG_CURRENT_DESKTOP=sway
# save environment variables that will be added to systemd
-new_env=$(systemctl --user show-environment | cut -d'=' -f 1 | sort | comm -13 - <(env | cut -d'=' -f 1 | sort))
+sys_env=$(systemctl --user show-environment | cut -d'=' -f 1 | sort)
+user_env=$(env | cut -d'=' -f 1 | sort)
+new_env=$(echo "$sys_env" | comm -13 - <(echo "$user_env"))
+shared_env=$(echo "$sys_env" | comm -12 - <(echo "$user_env"))
# import environment variables from the login manager
-systemctl --user import-environment
+systemctl --user import-environment $new_env $shared_env
# then start the service
systemctl --wait --user start sway.service
--
2.35.1