From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oJghDz+OWGH0XwEAgWs5BA (envelope-from ) for ; Sat, 02 Oct 2021 18:52:15 +0200 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id GOaXCj+OWGEZEwAAbx9fmQ (envelope-from ) for ; Sat, 02 Oct 2021 16:52:15 +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 aspmx2.migadu.com (Postfix) with ESMTPS id E08F92E9FC for ; Sat, 2 Oct 2021 18:52:13 +0200 (CEST) Received: from localhost ([::1]:53938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWiFA-0008ET-DX for larch@yhetil.org; Sat, 02 Oct 2021 12:52:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWiF0-0008Au-2B for guix-patches@gnu.org; Sat, 02 Oct 2021 12:52:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48919) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWiEz-0005zd-QV for guix-patches@gnu.org; Sat, 02 Oct 2021 12:52:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWiEz-0000Fj-Ma for guix-patches@gnu.org; Sat, 02 Oct 2021 12:52:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50563] [PATCH [0/2] gnu: GDM: Add Wayland support Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 02 Oct 2021 16:52: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: Mathieu Othacehe Cc: "50563@debbugs.gnu.org" <50563@debbugs.gnu.org> Received: via spool by 50563-submit@debbugs.gnu.org id=B50563.1633193507948 (code B ref 50563); Sat, 02 Oct 2021 16:52:01 +0000 Received: (at 50563) by debbugs.gnu.org; 2 Oct 2021 16:51:47 +0000 Received: from localhost ([127.0.0.1]:60465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWiEl-0000FD-67 for submit@debbugs.gnu.org; Sat, 02 Oct 2021 12:51:47 -0400 Received: from mail-4323.protonmail.ch ([185.70.43.23]:63927) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWiEi-0000Ew-0Z for 50563@debbugs.gnu.org; Sat, 02 Oct 2021 12:51:46 -0400 Date: Sat, 02 Oct 2021 16:51:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=protonmail2; t=1633193497; bh=MAOIO24EZN8y+KDnBl+rq1k6XQ5M/2LeaEy3IHlOUTo=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=lOpPMc6W17xBdW/B0VrMLvx+CSSMm8BGbsBtLZf5B1/Voteps5ShprFXlEA5AWaeF PjWFrYp8L5xx6Fjzaoihu5HHx28T+ifZ5jeElb+9YtCV9X9Pjt/UQIDczl8zptNfkK M8M6NX1wvJeTMX7kiFqRP13jvobd/EzH2IvbwNne1UbA4zoA+WEcOYusaVFkoLz8cq uFcOdCU1rj+zTkjLaviPPIuzqWnIHj/mzprUW91zZzh1XdC/yBDE1vkdHZz1Vy02WG pUYgtTbft6avmmMeSFEkHgEFDdjQynYVnT6gRvU68egAwy09tvvEKQYqq9Hv4a+2ca RqzhVPB08VMJA== From: Josselin Poiret Message-ID: In-Reply-To: <87v92hp0kb.fsf@gnu.org> References: <_O63PhtCI8ZiwBgDZppLf6SqqIgEm3Y0iFYKUIsuLOeAM4yMfbqumjltWSuHKl8tfgUdL0yAC2TVR4nqKvLNJ18Rgs7iImwzPAztAEvIcmM=@jpoiret.xyz> <875yuhqjp0.fsf_-_@gnu.org> <87v92hp0kb.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=1633193534; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=MAOIO24EZN8y+KDnBl+rq1k6XQ5M/2LeaEy3IHlOUTo=; b=ME2wo+8enQCPKgkK021qM4DvS/evzOavAqYF0+RQniuUwrkPEUum5SViCoocJbZCyMrCEM 5iAE/rSlYyctBWtv6zk8MczXC1CBkF3D+Nl8Ge/7JcObaVZJWh6LB7V5FLnIwxMPJKEDRB KbykpTnNmydEK3vaShWlDhMwWw1ZR0gjKpLiz/3YP4wfbGlXVBsFFple5Fm8gRVSt41/HX PQoXjTmqbdtARxjKNxYv9KyHdkzXSE6b9adLuDw3I+fZON8K+AFIgX6mUCwrNu4AI5O4rP rdcawErnXPNfPW1lDZaY/WQoCHACA6ic4fvDn6b0kZN+YQs9Jb7bkY5+9LbMUA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633193534; a=rsa-sha256; cv=none; b=Bfs7qn52KY+6IiwB8x4eLSkpbG50wwR8Nx7EcGzcZcRMlnDRmT4LMaIYLmrRaGxm20qMcj dhWHdl5UZyY4xpRwPHP9KS77XAZEIZ0O1B+cwEKAzJxkOrwTz1bk9dohrH6/IvjooVXK/D SG4MlD8wZ6glpEfHD7NV6SM8DCtgW4NFqC9Yr/FofbVL5oxBfWD2/k1Bf2BqJkmAODzTYR vy7wkGshzm7NwFlSFIAwvGxsPpBuw3gZoEKugNFwEepm7gSBmc1owzXOGl11RManP9Eu24 zwi2oVmvBMtkHNBF55Onru+YF8I2HXtXi476QpV8tQw8YUvKvRVFvj2CvJxKJQ== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=protonmail2 header.b=lOpPMc6W; spf=pass (aspmx2.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.41 Authentication-Results: aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=protonmail2 header.b=lOpPMc6W; dmarc=none; spf=pass (aspmx2.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: E08F92E9FC X-Spam-Score: -1.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: ShJyPjzsUQxp On Friday, October 1st, 2021 at 9:16 AM, Mathieu Othacehe wrote: > I see that for explaining! This would deserve a comment I think, could > you please send a v2 for the second patch? * gnu/packages/patches/gdm-wayland-session-wrapper-from-env.patch: Patch GD= M to support launching a wrapper script for Wayland sessions. * gnu/services/xorg.scm (gdm-configuration): Add `wayland-session` in `gdm-= configuration` to specify the wrapper to use. * gnu/services/xorg.scm (gdm-wayland-session-wrapper): Add default wrapper = that runs non-GDM sessions through a login shell (based on the `xinitrc`). * doc/guix.texi: 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 | 25 +++++++++++-- 4 files changed, 64 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 9e80a2c397..21c1fc04e1 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18201,6 +18201,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 f155867dfc..ca4d00917d 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..122dd14ae2 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -869,6 +869,23 @@ the GNOME desktop environment.") (apply execl (string-append #$dbus "/bin/dbus-daemon") (program-arguments))))) +;; Wrapper script for Wayland sessions, similar to Xsession. See `xinitrc`= . +;; By default, launches the specified session through a login shell. +;; With default Guix configuration, this should source /etc/profile, +;; setting up Guix profile environment variables. +;; However, gdm launches its own graphical session through the same method= , so +;; we need to ignore this case, since `gdm` doesn't have a login shell. +(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 +901,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 +1000,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 > That's unrelated, but what's your take on enabling wayland by default on > GDM, like some other distributions? Just ran a quick search and it looks > like it could be problematic for Nvidia users. I'd be mostly in favor of it, as this makes the experience smoother when tr= ying to use a Wayland compositor "out-of-the-box" (sway and such are gettin= g quite popular). For Nvidia users, they mostly are aware of the driver shortcomings (and it = seems that the incompatibility will soon disappear anyway), maybe a short heads-up in the documentation would suffice. Thanks again for the review, Josselin