From 6b7c5ba5353e2a81255879173de758fc5f08be62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 28 Feb 2017 11:05:55 +0100 Subject: [PATCH] display-manager: fix argument handling of sddm previously session type was not correctly set. fixes #23264 --- .../modules/services/x11/display-managers/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix index 4e2c0e01ca0..543fd939914 100644 --- a/nixos/modules/services/x11/display-managers/default.nix +++ b/nixos/modules/services/x11/display-managers/default.nix @@ -32,8 +32,14 @@ let '' #! ${pkgs.bash}/bin/bash - # Handle being called by SDDM. - if test "''${1:0:1}" = / ; then eval exec $1 $2 ; fi + # SDDM splits "Exec" line in .desktop file by whitespace and pass script path as $1 + if [[ "$0" = "$1" ]]; then + # remove superfluous $1 again + shift + # join arguments again and evaluate them in a shell context + # to interpret shell quoting + eval exec "$0" "$@" + fi ${optionalString cfg.displayManager.logToJournal '' if [ -z "$_DID_SYSTEMD_CAT" ]; then