From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id eJ2ABcwZeGfdZAAAe85BDQ:P1 (envelope-from ) for ; Fri, 03 Jan 2025 17:09:32 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id eJ2ABcwZeGfdZAAAe85BDQ (envelope-from ) for ; Fri, 03 Jan 2025 18:09:32 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=QiqC2bqw; dkim=fail ("headers rsa verify failed") header.d=muradm.net header.s=mail header.b=nunyvsKG; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=muradm.net (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735924171; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: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=D+GhY1McjJviJkf/cOF40K8c4Xn4PRer89TG5Ree0W4=; b=jiXXG8DFhvR2tguwisKv1V2/bu9l7QTJ/REpAKJ3DdxF1KZqs0KXQCUpwCORv7p8LL7Bu1 yX0xO67BC0LkIc1Ls2pOWR8SbrA1EQ8rAPu33wih+ROFnxv6cgdh+C9yJpCmJEAIazMUIA R/6YrEGQUAjZ4JYQLkiZT4FLoFGe3jhp5TaTYp81rS6IAHbPg/OZ7OWOHgK/vlbeBEIWgW jmSRKDXcHDEV5Hl9BD+ZzxDJjqyxNwvQKSOS9zXIsliMQhE7WAulUjON4LRHgEQUeuSZK5 t+c/xkkBYizp23yStDhei5E8ZozXDlZ62+7XyKRznLqdzS1VnqnfBT12ZQohIQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=QiqC2bqw; dkim=fail ("headers rsa verify failed") header.d=muradm.net header.s=mail header.b=nunyvsKG; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=muradm.net (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735924171; a=rsa-sha256; cv=none; b=cGiyfItkedWlEnSb3FTPhKPbmaTQosFZOzYHNjCoLOI7hj/312jQtB2wos5RTGkWgK7OV7 vziQ4ANSVwbqZvsFHOOkFn506+MNFkVAAkBth0HHcCOeooTFDW5+0z+9lMdUg5BjTIqfHm MnX8Ex7RR3wvQf3atiMT1Pv6EbvtAdOA5FrbHfP/4hIHvI2NvZMUz2qLGzoWjMfxqdNnE4 BQGM0Syabe6+hdviWzySONRQmEJAh9xC0EERsbsqU+oaCp9R+/6LST9cMb7/LhklC8XuM/ R+RcCxI2m+ozFlOYihlmbZCVJ15ODwfBnTgt9VEROAWdGa5XiAElkjoHF+Xm8A== 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 A34577471 for ; Fri, 03 Jan 2025 18:09:31 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTlAX-0008Ua-8v; Fri, 03 Jan 2025 12:09:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tTlAV-0008UQ-9R for guix-patches@gnu.org; Fri, 03 Jan 2025 12:09:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTlAU-0006Qg-KC for guix-patches@gnu.org; Fri, 03 Jan 2025 12:09:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=D+GhY1McjJviJkf/cOF40K8c4Xn4PRer89TG5Ree0W4=; b=QiqC2bqwA+qvKu7Cd6TU8VCEDvADfuYB2U6BwtRmQggsP1enDPk0wpBwMlwnClVlFXNm8soJCIlNxJo1E15r7dkQEOW6KXlgARMrcvVn0UgHNhsqkC8br9D0z3/ZKB+KP/AV1i9tP9IEQbpk4Akn0CBoUwKFJTUT5bpoR43LebGTJYG4+jAY29VU+VpBQEaomzwO3Z9rgeMwpUBsgfFEO1+ugTR5w7PgXmBcCjRCtKkvCGgSe6qEab7RXzb82wQi6Kv4yosN7eKs098uuH3jOIhRx1lj6dq0yHkEnfXAedP/KoSPj8C49sP04yFY26KodAvhAUp8Yan4U+h+DNGAsw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTlAT-0003Et-UN for guix-patches@gnu.org; Fri, 03 Jan 2025 12:09:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75270] [PATCH 1/3] services: greetd: Improve greeter configurations. Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Jan 2025 17:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75270 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Nicolas Graves Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 75270@debbugs.gnu.org, Maxim Cournoyer Received: via spool by 75270-submit@debbugs.gnu.org id=B75270.173592413612440 (code B ref 75270); Fri, 03 Jan 2025 17:09:01 +0000 Received: (at 75270) by debbugs.gnu.org; 3 Jan 2025 17:08:56 +0000 Received: from localhost ([127.0.0.1]:51875 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTlAN-0003Ea-UM for submit@debbugs.gnu.org; Fri, 03 Jan 2025 12:08:56 -0500 Received: from nomad-cl1.muradm.net ([139.162.159.157]:38306) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tTlAJ-0003EF-LB for 75270@debbugs.gnu.org; Fri, 03 Jan 2025 12:08:53 -0500 Received: from localhost ([127.0.0.1]:40788) by nomad-cl1.muradm.net with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.1) (envelope-from ) id 1tTl6V-0001Ge-3A; Fri, 03 Jan 2025 17:04:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=muradm.net; s=mail; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=D+GhY1McjJviJkf/cOF40K8c4Xn4PRer89TG5Ree0W4=; b=nunyvsKGwSFhGP6iiHQeLPg3sl ZSg4L1g+eDTKl5ualKbsBbCUG9p2T7jKkpLiPIZuwIvVmlUHvgmnz1usok1d4LelOZ4SD7L0JREt8 l2LahjOOk/nkjCchUHKFcAqHasGbAFenlnW028zwy4vp0D0sHPl7f8/gFpAy0DHZcRaEFgXIIjLDR rZlkdUMhnr7WNTcR599axlYIPt1xKZ4nWyxVZAjcgcmC3FgzLF3hvwa8N9Gp200Z0DaOgP0/NbFfk 6ioALL4iLj8oqQx6MeF8ENLkQQsz1RNHVkg8fFWtnffXsJMp/ghAGJ8trhYtTJIZRso1Oq83HewuC NInOeGDzxv8K7IyaoTRZc7GMh6oEKLpQwMSWlIMukTXPejUtQAEPVXHDp4UJtlr0+AYkzJGksCGvI YEYPXzLZ2frdrohpybJ3hUgGHAB4ZjkZShU3UBj8LtpmNpqJdvUGh4947RpG6xLKAY6TEJ1WAEiGc C8xPiSwFYCHAfbfibmKrDlIW; Received: from muradm by localhost with local (Exim 4.98) (envelope-from ) id 1tTlAA-000000006gU-1jbU; Fri, 03 Jan 2025 20:08:42 +0300 From: muradm In-Reply-To: <87pll4owui.fsf@ngraves.fr> (Nicolas Graves's message of "Fri, 03 Jan 2025 14:23:01 +0100") References: <8ea5f949f8b473c3ec68e7d2f5f40c1152c6c631.1735771462.git.mail@muradm.net> <87pll4owui.fsf@ngraves.fr> User-Agent: mu4e 1.12.7; emacs 29.4 Date: Fri, 03 Jan 2025 20:08:42 +0300 Message-ID: <87ed1j6d0l.fsf@muradm.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -2.46 X-Spam-Score: -2.46 X-Migadu-Queue-Id: A34577471 X-TUID: eVv8B5AouZP0 --=-=-= Content-Type: text/plain; format=flowed Nicolas Graves writes: > On 2025-01-02 01:53, muradm wrote: > >> This improvement focuses on providing common user session >> scripts >> for use by multiple greeters. It also fixes incorrect use of >> `XDG_RUNTIME_DIR` for `wlgreet`. `wlgreet` requires compositor >> to >> run. We provide common sway based greeter script, which can be >> shared by other graphical greeters. > > [...] > >> +(define (make-greetd-sway-greeter-command sway sway-config) >> + (let ((sway-bin (file-append sway "/bin/sway"))) >> + (program-file >> + "greeter-sway-command" >> + #~(begin >> + (let* ((username (getenv "USER")) >> + (useruid (passwd:uid (getpwuid username))) >> + (useruid (number->string useruid)) >> + ;; /run/user/ won't exist >> yet >> + ;; this will contain WAYLAND_DISPLAY socket >> file >> + ;; and log-file below >> + (user-xdg-runtime-dir "/tmp/greeter-xdg-rt") >> + (log-file (string-append (number->string >> (getpid)) ".log")) >> + (log-file (string-append user-xdg-runtime-dir >> "/" >> log-file))) > > Could you explain why this is necessary? If I'm not mistaken, > we didn't > used a special runtime dir in RDE, and it worked OK. > When you start sway, it has to put WAYLAND_DISPLAY somewhere. By default it is put to `/run/user/`. However greeter is special limited user which is used to run without logging in. Because of that, `/run/user/` is not created by PAM mount. For special purpose we can use any XDG_RUNTIME_DIR. Sway does not support specifying location of WAYLAND_DISPLAY as far as I remember (I was opening an issue about it long ago, still was not resolved). >> + (mkdir user-xdg-runtime-dir #o700) >> + (setenv "XDG_RUNTIME_DIR" user-xdg-runtime-dir) >> + (sleep 1) ;; give time to elogind or seatd >> + (dup2 >> + (open-fdes >> + log-file >> + (logior O_CREAT O_WRONLY O_APPEND) >> + #o640) >> + 1) >> + (dup2 1 2) > > Maybe also here a tiny comment on why this is better than the > previous > fileno approach. > dup2 takes file descriptor, open-fdes provides in one go. Otherwise technically it does not matter how you acquire file descriptor. This script I created long ago for greeters. This is my recent version. >> + (execl #$sway-bin #$sway-bin "-d" "-c" >> #$sway-config)))))) > > Also, what about the XDG_CURRENT_DESKTOP setting? Should it not > be added > with xdg-env too? You don't need it, to run single sway process with single greeter application. Keep in mind that there is an "environment" to run greeter, and another "envrionment" for user after the login. They do not overlap. If you need XDG_CURRENT_DESKTOP for user after login, it could be set by window manager, desktop environment, manually in profile or manually in `extra-env` of `greetd-user-session`. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEESPY5lma9A9l5HGLP6M7O0mLOBeIFAmd4GZoACgkQ6M7O0mLO BeJUbA/+OHhZQ4PMvGt59Wr5AFuFJrsPV48ei25m8ZX2bv1K8GHrR2ZzSGicb7o2 1h8vYVZpBRlQzVgTtgaVFvlaJuNbcBgdVSziPtxHQO900J3iQZAEHT158PQjrs6j EBjcS5kBSl2zebasYoxi+P6dVlPana/xhS9MLv3k391Ksyy24jVYzAJh/I4uS9R+ 7RpQsHUWn6xmuh/Pr04Nkg+MChLfK5oSrbOR/fKah2a5tZQRhpQLq7weeC0juP8k QzIhPH1WP43i3nA5CmQFEC3849NNXFyodE1k8QovKWgZhRP2FEllibVMf3sUOz42 6WHZxXuyJOZvfX0trjaMomy5uJDJKjZEqdoROCqn/4bnYozRuL7Xe2R8hwh26PII TApohuu0JUDl+c1TcVDF1qDqth7uyEqDhE9Xc2gLgi9bplQi8cn4CNGR84HlVOIy KZeEf2kkqM+Vq6EeAEElHwB2N84/mJPJ/dVhipD4R+lYdzfEMAEEhevWmyZqUNfE d77lu20pa5N2MRpRkRDgyvYYywIsU8viFRzC0S9+GR5PT7hluDaYSydjVV9BbfOt k36wU8+yhl3P/17S2g4XZ0b5CsLVdifOp4l8jCm4N6aa+vlAAOocIJZMUpxRI6DG QYptdzen2I9/TPZ5AXi4y1SxRhQRMHfN60fRgFW1jbf5bj70l9I= =SoxH -----END PGP SIGNATURE----- --=-=-=--