From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6HUsNFlrP2G9YAAAgWs5BA (envelope-from ) for ; Mon, 13 Sep 2021 17:16:41 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 4PPOL1lrP2HhdgAA1q6Kng (envelope-from ) for ; Mon, 13 Sep 2021 15:16:41 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 63F331C48C for ; Mon, 13 Sep 2021 17:16:41 +0200 (CEST) Received: from localhost ([::1]:35954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPnhI-0005Tr-Dh for larch@yhetil.org; Mon, 13 Sep 2021 11:16:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPnek-0002oJ-DH for guix-patches@gnu.org; Mon, 13 Sep 2021 11:14:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35070) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPnek-0000Qy-5b for guix-patches@gnu.org; Mon, 13 Sep 2021 11:14:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mPnek-0001Mv-0j for guix-patches@gnu.org; Mon, 13 Sep 2021 11:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50563] [PATCH 2/2] gnu: gdm: Add Wayland session wrapper script. References: In-Reply-To: Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 Sep 2021 15:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50563 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "50563@debbugs.gnu.org" <50563@debbugs.gnu.org> Received: via spool by 50563-submit@debbugs.gnu.org id=B50563.16315459875164 (code B ref 50563); Mon, 13 Sep 2021 15:14:01 +0000 Received: (at 50563) by debbugs.gnu.org; 13 Sep 2021 15:13:07 +0000 Received: from localhost ([127.0.0.1]:46610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPndq-0001LC-LA for submit@debbugs.gnu.org; Mon, 13 Sep 2021 11:13:07 -0400 Received: from mail-4317.protonmail.ch ([185.70.43.17]:39757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPgio-0002gM-Fa for 50563@debbugs.gnu.org; Mon, 13 Sep 2021 03:49:47 -0400 Date: Mon, 13 Sep 2021 07:49:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.ch; s=protonmail; t=1631519379; bh=Hil4mbvHuZ4MbWJ7orIctLxbN1JgouwQhBl7q11Dx8c=; h=Date:To:From:Reply-To:Subject:From; b=MYx3G+/GC5TK+GqXtkJAOPpTRrKyy22f0LBnAphLOkipoIuoCXm8vkwr+GQfpG4k2 8NDPxWmwEp3sfFmKM9sPC7+lWrSaI9wHHmM8x7bUl1Lnx6Rtfk73G2LDFE9lzhxnLe 46CCet2NM9OA+X8MlurffF3A+7VS2JuB5Xi2cz1k= Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Mon, 13 Sep 2021 11:13:05 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches From: Josselin Poiret via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631546201; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Hil4mbvHuZ4MbWJ7orIctLxbN1JgouwQhBl7q11Dx8c=; b=P/blHF8Rt1VOV2OV7PEkxAszAdiBXXMn2A5EzAzzLmtil8+PYLwxpyFCTM5S+fjF/uPSV5 FNstENU5vitwy4HjZjJek37h9gKKkU6gDtwMRcUCRvXGkXBHhnQT4QopO+4KXrw0g4zeV9 AE8/e0l31GKFmx/YWZ5EUiKPQCYOlqLEKX0GdTTbKcMckn5+r79mee7PAydCawh8Rdx0fw cjuByzHtMrs0RWh0ee4jZ9APNavnkOwzZ3vMx6I//uC3t1mLbPpkET2DNffTygcILOhdCA DxP0pqr36jpPRS/HnWL5ra/FVPV+uY7XrYNEIs7OyMzmrU7vT80gCfhxlemrZQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631546201; a=rsa-sha256; cv=none; b=E1CHFB727Fa6kR6RhhH2+k2QyoCjXqLa2R8go5WN10D6/KsP3Oz60UqcPYq9zfn7fTrbLT h+51Y+pNP87cLBKGfDZQx9Gi3Z6Y3ndzS+ofuAbl8h4JWkoNz9anxKQze1ReTv7/fs/K31 KPMFSULTUBJwOCM1Jb2T1uCvo17Rls3fWyj+GYJe2ikZUsYpGuT9V9aZilCYJDkVI8FcRS TUUEj9nOZT4MssyNwI0DdcnBIIfZVZJA4FTSYA8MSCYCQkFEB1E2njBt7qxx29ONJLndC0 KdBltfKb7wM+jfZ41Q5XNmQAVm6mK4dL2G+Txghg4lHGK5JKMpqVK2kHIFMM0g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=protonmail.ch header.s=protonmail header.b="MYx3G+/G"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=protonmail.ch header.s=protonmail header.b="MYx3G+/G"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 63F331C48C X-Spam-Score: -2.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: wel5qgP3iG15 * Patch GDM to support launching a wrapper script for Wayland sessions. * Add `wayland-session` in `gdm-configuration` to specify the wrapper to us= e. * Add default wrapper that runs non-GDM sessions through a login shell (bas= ed on the `xinitrc`). * Update the documentation with those changes. --- doc/guix.texi | 4 +++ gnu/packages/gnome.scm | 3 +- ...gdm-wayland-session-wrapper-from-env.patch | 35 +++++++++++++++++++ gnu/services/xorg.scm | 21 +++++++++-- 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/gdm-wayland-session-wrapper-from-e= nv.patch diff --git a/doc/guix.texi b/doc/guix.texi index 93ea4a321f..3e6157c8ab 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18098,6 +18098,10 @@ The GDM package to use. @item @code{wayland?} (default: @code{#f}) When true, enables Wayland in GDM, necessary to use Wayland sessions. + +@item @code{wayland-session} (default: @code{gdm-wayland-session-wrapper}) +The Wayland session wrapper to use, needed to setup the +environment. @end table @end deftp diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 2da0b3791f..36d58e4c42 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -8112,7 +8112,8 @@ library.") (base32 "1lyqvcwxhwxklbxn4xjswjzr6fhjix6h28mi9ypn34wdm9bzcpg8")) (patches (search-patches "gdm-default-session.patch" - "gdm-remove-hardcoded-xwayland-path= .patch")))) + "gdm-remove-hardcoded-xwayland-path= .patch" + "gdm-wayland-session-wrapper-from-e= nv.patch")))) (build-system glib-or-gtk-build-system) (arguments '(#:configure-flags diff --git a/gnu/packages/patches/gdm-wayland-session-wrapper-from-env.patc= h b/gnu/packages/patches/gdm-wayland-session-wrapper-from-env.patch new file mode 100644 index 0000000000..ca1af557ef --- /dev/null +++ b/gnu/packages/patches/gdm-wayland-session-wrapper-from-env.patch @@ -0,0 +1,35 @@ +Get wayland-session wrapper from environment + +--- + daemon/gdm-session.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c +index 4e303e70..1deca4e9 100644 +--- a/daemon/gdm-session.c ++++ b/daemon/gdm-session.c +@@ -2888,8 +2888,9 @@ gdm_session_start_session (GdmSession *self, + allow_remote_c= onnections? "--allow-remote-connections " : "", + command); + } else { +- program =3D g_strdup_printf (LIBEXECDIR "= /gdm-wayland-session %s\"%s\"", ++ program =3D g_strdup_printf (LIBEXECDIR "= /gdm-wayland-session %s\"%s %s\"", + register_sessi= on ? "--register-session " : "", ++ g_getenv ("GDM= _WAYLAND_SESSION"), + command); + } + } else if (run_xsession_script) { +@@ -2906,8 +2907,9 @@ gdm_session_start_session (GdmSession *self, + register_sessi= on ? "--register-session " : "", + self->selected= _program); + } else { +- program =3D g_strdup_printf (LIBEXECDIR "= /gdm-wayland-session %s\"%s\"", ++ program =3D g_strdup_printf (LIBEXECDIR "= /gdm-wayland-session %s\"%s %s\"", + register_sessi= on ? "--register-session " : "", ++ g_getenv ("GDM= _WAYLAND_SESSION"), + self->selected= _program); + } + } else { +-- +2.33.0 + diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index fe25168a58..a9b2a1a1c6 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -869,6 +869,19 @@ the GNOME desktop environment.") (apply execl (string-append #$dbus "/bin/dbus-daemon") (program-arguments))))) +;; Wrapper script for Wayland sessions, similar to Xsession. +;; Used to setup the environment. +(define gdm-wayland-session-wrapper + (program-file + "gdm-wayland-session-wrapper" + #~((let* ((user (getpw (getuid))) +=09 (name (passwd:name user)) +=09 (shell (passwd:shell user)) +=09 (args (cdr (command-line)))) + (if (string=3D? name "gdm") +=09 (apply execl (cons (car args) args)) +=09 (execl shell shell "--login" "-c" (string-join args))))))) + (define-record-type* gdm-configuration make-gdm-configuration gdm-configuration? @@ -884,7 +897,8 @@ the GNOME desktop environment.") (default (xorg-configuration))) (x-session gdm-configuration-x-session (default (xinitrc))) - (wayland? gdm-configuration-wayland? (default #f))) + (wayland? gdm-configuration-wayland? (default #f)) + (wayland-session gdm-configuration-wayland-session (default gdm-wayland-= session-wrapper))) (define (gdm-configuration-file config) (mixed-text-file "gdm-custom.conf" @@ -982,7 +996,10 @@ the GNOME desktop environment.") ;; Add XCURSOR_PATH so that mutter can find its= cursors. ;; gdm doesn't login so doesn't source the corr= esponding ;; line in /etc/profile - "XCURSOR_PATH=3D/run/current-system/profile/sha= re/icons")))) + "XCURSOR_PATH=3D/run/current-system/profile/sha= re/icons" + (string-append + "GDM_WAYLAND_SESSION=3D" + #$(gdm-configuration-wayland-session config)))= ))) (stop #~(make-kill-destructor)) (respawn? #t)))) -- 2.33.0