From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OK8OKPJqP2GfYQAAgWs5BA (envelope-from ) for ; Mon, 13 Sep 2021 17:14:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EOyZI/JqP2HcPwAAB5/wlQ (envelope-from ) for ; Mon, 13 Sep 2021 15:14:58 +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 3D8AC1C3DF for ; Mon, 13 Sep 2021 17:14:58 +0200 (CEST) Received: from localhost ([::1]:32870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPnfd-0003Ds-CL for larch@yhetil.org; Mon, 13 Sep 2021 11:14:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPnek-0002oM-Tm for guix-patches@gnu.org; Mon, 13 Sep 2021 11:14:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35071) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPnek-0000RG-LT 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-0001N3-Ee 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:02 +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.16315459885170 (code B ref 50563); Mon, 13 Sep 2021 15:14:02 +0000 Received: (at 50563) by debbugs.gnu.org; 13 Sep 2021 15:13:08 +0000 Received: from localhost ([127.0.0.1]:46612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPndr-0001LF-Gh for submit@debbugs.gnu.org; Mon, 13 Sep 2021 11:13:08 -0400 Received: from mail1.protonmail.ch ([185.70.40.18]:23174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPh7f-0003lr-CO for 50563@debbugs.gnu.org; Mon, 13 Sep 2021 04:15:28 -0400 Date: Mon, 13 Sep 2021 08:15:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=protonmail2; t=1631520920; bh=Hil4mbvHuZ4MbWJ7orIctLxbN1JgouwQhBl7q11Dx8c=; h=Date:To:From:Reply-To:Subject:From; b=UuZOWElJLbttdxJR0eDqLZwYgCG+8D5LxWKTeHZv6fGXb+BUToBSqXXuRwONQsfhn KxgJ5dusfxIucaXDNUw4SvF7idjJMFJ1XfjTZhZyVPmrAN8FkQsEfYIu/C5X+dagdu 1DgtgX0HgE1frmdsxc6XNgqA5mapQB3sKP2+c4YOurkPgj7yaQMKl2OWq3cqr6A8/u Mze3G1SOF69I9XkqU9iGTMTIMIK5L1JctxVCUZXUii292a6VyhxUv8QzN3uBSzr/in 6tQ7sbEo6tB7RLuYCY8SuK8wqWCoz5qGehPvddh6Da9UX6+rWAz/Gmv4tNvz9BH6Ae lWq7FPevvxaEA== From: Josselin Poiret Message-ID: <_O63PhtCI8ZiwBgDZppLf6SqqIgEm3Y0iFYKUIsuLOeAM4yMfbqumjltWSuHKl8tfgUdL0yAC2TVR4nqKvLNJ18Rgs7iImwzPAztAEvIcmM=@jpoiret.xyz> 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: , Reply-To: Josselin Poiret Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631546098; 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=F+AiamUG0vXtrGBRtkDTYpPEk1FhFbxmZ05e8FiQvFcLxSDQQVBXVwxEMeSX/kOK06pAm5 JDUBBvo+wbaeVXO4kKKKlrzZabOcIWbaAGfejAgnxm4qkCgxPTRgfBmPZWAsyD7zmgjI1B wsJLS9nsstkydOiXRlxlWfgwiXUcUvh/MYcY4VIf7RluOUZenF5E56cgr9nV1MESMkx8kN AH8Yav74vR2C+ShwSUX+KY45EOBZNX/nU2Cr2GWAyQaIt/SbOoNTCocbTjaEwD1pNaDusL NEQR5WE95sBa0Dl+1+AqRBEPeZCJTvtm7fjSdLG4HAdGL3EeRW1y1X9yAzKuqg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631546098; a=rsa-sha256; cv=none; b=uDDCLjT5i/4R2MDaBgMTAQp8cBAxlcb2dwqOrAgTxga3xFxx3Lei7JoKUMzkIGyig87onf YGMOZ8dsCzqvrIhL701U6/IsUTw95wryI1S4Iz7sGHgBLxhxjWfo5NfKKH/GjH3admmCy+ 384NybbduaKFMqSQKqzeRRWAmmP6qTkzjr1FlMYyzPyOZcDB8Li+oHbzOl0sMjgdCj6QIy SIQW/WX1H7TRre6Layfd/BF1Q9PZZ8hwyq5z/XVHcM6LD8MSnNyXoouaA7kYE78tik/ar0 h+MvayIipLFRHI+4Kd7kNV11jDVtrvN3Rz6SdlJoiX6o5G4Hgh556HWPYJWQ1w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=protonmail2 header.b=UuZOWElJ; dmarc=none; 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: -1.40 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=protonmail2 header.b=UuZOWElJ; dmarc=none; 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: 3D8AC1C3DF X-Spam-Score: -1.40 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9eELg6gshS7+ * 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