From unknown Tue Jun 17 20:26:05 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#57721 <57721@debbugs.gnu.org> To: bug#57721 <57721@debbugs.gnu.org> Subject: Status: [PATCH 0/4] gnu: base: Add greetd-wlgreet-sway-session. Reply-To: bug#57721 <57721@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:26:05 +0000 retitle 57721 [PATCH 0/4] gnu: base: Add greetd-wlgreet-sway-session. reassign 57721 guix-patches submitter 57721 "(" severity 57721 normal tag 57721 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 10 16:29:18 2022 Received: (at submit) by debbugs.gnu.org; 10 Sep 2022 20:29:18 +0000 Received: from localhost ([127.0.0.1]:40413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oX76M-00044o-5S for submit@debbugs.gnu.org; Sat, 10 Sep 2022 16:29:18 -0400 Received: from lists.gnu.org ([209.51.188.17]:36342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oX76J-00044f-Ew for submit@debbugs.gnu.org; Sat, 10 Sep 2022 16:29:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oX76J-0000t8-1h for guix-patches@gnu.org; Sat, 10 Sep 2022 16:29:15 -0400 Received: from knopi.disroot.org ([178.21.23.139]:45906) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oX76G-0004jl-N1 for guix-patches@gnu.org; Sat, 10 Sep 2022 16:29:14 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id B127149F84; Sat, 10 Sep 2022 22:29:09 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id snfkxyuMpQPn; Sat, 10 Sep 2022 22:29:08 +0200 (CEST) From: "(" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662841748; bh=gewnOwKu+NpN1FfVh2f5cVJwrFt+Z29W1i3LDVHtEYI=; h=From:To:Cc:Subject:Date; b=VjR7eAOy3Y1LwhVK8xtK44rBxVIdg3UpkdMe5VA9SAg+XR/ey3Q5CZYIhnXv0Apxi u+ongmAl1ga3MfkqUDKIaglSDawIIhaJpIciKQ5OKWPL/p+rRn1j+kRbawHqTAJlXP QG6qI+4hgKRxdTS6lpq2w5nq4JZzneGgva0Mx2Bv5k7WYYbiDJx2VyrftB4X9Zvbud xZO+jdMwM+aNTnukkVpAeCJzguTbD0GKK8PtkVncz4D2h2bIDUKBHdcZZnYtgGMgUd +Z3kEG50DxEhIF5HRc8mNpcrUED6GT65MX1BA877S0lmrwV4KWCDdjQ38ZW0S5AYX6 OIHBBvAMadF7Q== To: guix-patches@gnu.org Subject: [PATCH 0/4] gnu: base: Add greetd-wlgreet-sway-session. Date: Sat, 10 Sep 2022 21:29:03 +0100 Message-Id: <20220910202903.17482-1-paren@disroot.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=178.21.23.139; envelope-from=paren@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_ONE_CHAR=1.224, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: submit Cc: "\(" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) Hey Guix! This patchset adds support for a second greetd greeter: wlgreet. This is my first time contributing additions to the documentation, so I probably got something wrong there; corrections would be appreciated! ( (4): gnu: Add rust-greetd-ipc-0.8. gnu: Add rust-os-pipe-0.8. gnu: Add wlgreet. gnu: base: Add greetd-wlgreet-sway-session. doc/guix.texi | 76 +++++++++++++++++++++++ gnu/packages/admin.scm | 71 +++++++++++++++++++++ gnu/packages/crates-io.scm | 46 +++++++++++++- gnu/services/base.scm | 122 +++++++++++++++++++++++++++++++++++++ 4 files changed, 314 insertions(+), 1 deletion(-) -- 2.37.3 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 10 16:30:41 2022 Received: (at 57721) by debbugs.gnu.org; 10 Sep 2022 20:30:41 +0000 Received: from localhost ([127.0.0.1]:40421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oX77g-000492-GL for submit@debbugs.gnu.org; Sat, 10 Sep 2022 16:30:40 -0400 Received: from knopi.disroot.org ([178.21.23.139]:34206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oX77e-00048m-OI for 57721@debbugs.gnu.org; Sat, 10 Sep 2022 16:30:39 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 9BB1841663; Sat, 10 Sep 2022 22:30:37 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2GOAsXR08KzM; Sat, 10 Sep 2022 22:30:36 +0200 (CEST) From: "(" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662841836; bh=9gxHPnsZJa+LdDcaMvNMK3N5+11B9TfHh+uZvFGg5zI=; h=From:To:Cc:Subject:Date; b=Myd+MjhuNKy/X3VIimfJVH51p9eUZEbmdc8QnRLyz0TVlQGuvkfH1WTc6v/1KzPjr 0Ea4wfw01hdn3C0COQpx6w/2L0vNGREOoQUJhnwrhkqr6ni0TS8dJ/aaEalaCzpHUB nBWRsr08vVJpOzOgvuWd7wOuKLCxjEUnJS8TPqyFwUiH79iWAN7Q2uJrjCCRyQagEV 41hTrYKIDPpVzlIEqlUr9mrx0cimJarqdbrq0PkhJQZ4gF+cWlKiPjHpHnbLaqTJkt LWCFizSmeo8ACE4fygAde7y3zkm25YGFwzWt0WV3Ag/ESQHFFJhg9XgocVNvbP5oyB 8hy7r/KmYP4Zw== To: 57721@debbugs.gnu.org Subject: [PATCH 1/4] gnu: Add rust-greetd-ipc-0.8. Date: Sat, 10 Sep 2022 21:30:29 +0100 Message-Id: <20220910203032.17699-1-paren@disroot.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 57721 Cc: "\(" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * gnu/packages/crates-io.scm (rust-greetd-ipc-0.8): New variable. --- gnu/packages/crates-io.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index 02f7bc7d4d..c7b971ffc2 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -28,6 +28,7 @@ ;;; Copyright © 2022 Marius Bakke ;;; Copyright © 2022 Evgenii Lepikhin ;;; Copyright © 2022 Gabriel Arazas +;;; Copyright © 2022 ( ;;; ;;; This file is part of GNU Guix. ;;; @@ -26136,6 +26137,32 @@ (define-public rust-goblin-0.0 loading crate.") (license license:expat))) +(define-public rust-greetd-ipc-0.8 + (package + (name "rust-greetd-ipc") + (version "0.8.0") + (source (origin + (method url-fetch) + (uri (crate-uri "greetd-ipc" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1dscriv3adjyaxfaax3cmqrzx6q2vwwchbh86dhll783wjc4ivw0")))) + (build-system cargo-build-system) + (arguments + (list #:cargo-inputs + `(("rust-async-trait" ,rust-async-trait-0.1) + ("rust-serde" ,rust-serde-1) + ("rust-serde-json" ,rust-serde-json-1) + ("rust-thiserror" ,rust-thiserror-1) + ("rust-tokio" ,rust-tokio-1)))) + (home-page "https://kl.wtf/projects/greetd") + (synopsis "@command{greetd} IPC protocol library for Rust") + (description + "This package provides library that helps you use the +@command{greetd} JSON-based IPC protocol from Rust.") + (license license:gpl3))) + (define-public rust-grep-0.2 (package (name "rust-grep") -- 2.37.3 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 10 16:30:43 2022 Received: (at 57721) by debbugs.gnu.org; 10 Sep 2022 20:30:43 +0000 Received: from localhost ([127.0.0.1]:40424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oX77j-00049H-0g for submit@debbugs.gnu.org; Sat, 10 Sep 2022 16:30:43 -0400 Received: from knopi.disroot.org ([178.21.23.139]:34370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oX77f-00048o-59 for 57721@debbugs.gnu.org; Sat, 10 Sep 2022 16:30:39 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 826DA4A01F; Sat, 10 Sep 2022 22:30:38 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id j8vAsTyT3Ib2; Sat, 10 Sep 2022 22:30:37 +0200 (CEST) From: "(" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662841836; bh=juCQwbElWbmqmXiQivx3Yv4h73YCvzlTPdcpC5PJReg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ydsmq6IAuNBBmgD7YwvF0stvIxdazA/m7jQ+TTfqonHhrJF5qljX4huavaY84Ttj2 2bVD+z0vIUOUClGgxmSvGaRrJ0ncOt9SL0pYyaRrSpxuFigbPWWBZRkhwYrptT5lzI nV/fO6Re8nbOyTqjlBkiOSa4FlVb1TzJJRnC7t4nirQWUktcn+WxqBP7TAFA1SjaKR S/1zrZ+fnRIZH3ABw/3uSG9tLY6owXNo8JWj25DU1tJQKGG2hevHYMCrzJ2XcGQO9g e0gwiJYPEtx9Rop5dn76Dm9d0qGDPmps4M75V5CIwC6Bp641iZNS5MdDPrS4u2F/eC SX0tfyZY+NoRw== To: 57721@debbugs.gnu.org Subject: [PATCH 2/4] gnu: Add rust-os-pipe-0.8. Date: Sat, 10 Sep 2022 21:30:30 +0100 Message-Id: <20220910203032.17699-2-paren@disroot.org> In-Reply-To: <20220910203032.17699-1-paren@disroot.org> References: <20220910203032.17699-1-paren@disroot.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 57721 Cc: "\(" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * gnu/packages/crates-io.scm (rust-os-pipe-0.8): New variable. --- gnu/packages/crates-io.scm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index c7b971ffc2..f1a84e9d22 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -40800,10 +40800,27 @@ (define-public rust-os-pipe-0.9 "04yjs1hf88jjm17g8a2lr7ibxyyg460rzbgcw9f1yzihq833y8zv")))) (native-inputs (list)))) -(define-public rust-os-pipe-0.5 +(define-public rust-os-pipe-0.8 (package (inherit rust-os-pipe-0.9) (name "rust-os-pipe") + (version "0.8.2") + (source (origin + (method url-fetch) + (uri (crate-uri "os-pipe" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "049ax8shxik7mm68r2nf7xnrcq3z3p7hz54sbrcxwywxqsjdzs41")))) + (arguments + (list #:cargo-inputs + `(("rust-nix" ,rust-nix-0.15) + ("rust-winapi" ,rust-winapi-0.3)))))) + +(define-public rust-os-pipe-0.5 + (package + (inherit rust-os-pipe-0.8) + (name "rust-os-pipe") (version "0.5.1") (source (origin -- 2.37.3 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 10 16:30:44 2022 Received: (at 57721) by debbugs.gnu.org; 10 Sep 2022 20:30:44 +0000 Received: from localhost ([127.0.0.1]:40426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oX77j-00049K-F3 for submit@debbugs.gnu.org; Sat, 10 Sep 2022 16:30:43 -0400 Received: from knopi.disroot.org ([178.21.23.139]:34426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oX77f-00048p-Jz for 57721@debbugs.gnu.org; Sat, 10 Sep 2022 16:30:40 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id ECDEC49FE8; Sat, 10 Sep 2022 22:30:38 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bxClRDkEX276; Sat, 10 Sep 2022 22:30:37 +0200 (CEST) From: "(" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662841836; bh=b6IqmkhbmAX9/nNvFD/UbuMvQ9XAH9T0qh8+vFKL2ME=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iZw6WCFB74ZwL4PCf/qQ81kiJAO+2dJ0COMIoGDj3RcVtsYbrq0NGd5QhfTolDEUR v+o0LXFun1sTCjzORB5mHj7qfSu5CkJJg9mG2W2l+G8N5oC3mjuxL0cJ+Ajv4QuEQz EC/YoOUF9EaK9iTc7a6K0FmJtZEXhnvLLr0j+mUTDGub25TYUgZbeXxs05o52xtmXX D/j6Wl2bhamWXZfyqMzMhqV6sZhqhiw2zZdzXC7Drag0Jjr9MwQ6QzHrr2Q/SK/Ky1 KPV0VliFgLlW4O2Tiw9TKK92WO/6HHO9Ue8s4fJWFB6dhI4nQ4Lyf6D4rfKxkEFqNQ fn39pEmWG8I/Q== To: 57721@debbugs.gnu.org Subject: [PATCH 3/4] gnu: Add wlgreet. Date: Sat, 10 Sep 2022 21:30:31 +0100 Message-Id: <20220910203032.17699-3-paren@disroot.org> In-Reply-To: <20220910203032.17699-1-paren@disroot.org> References: <20220910203032.17699-1-paren@disroot.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 57721 Cc: "\(" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * gnu/packages/admin.scm (wlgreet): New variable. --- gnu/packages/admin.scm | 71 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 21f9176bfa..bf76d3bd30 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -51,6 +51,7 @@ ;;; Copyright © 2021 Artyom V. Poptsov ;;; Copyright © 2022 Wamm K. D. ;;; Copyright © 2022 Roman Riabenko +;;; Copyright © 2022 ( ;;; ;;; This file is part of GNU Guix. ;;; @@ -97,6 +98,7 @@ (define-module (gnu packages admin) #:use-module (gnu packages c) #:use-module (gnu packages check) #:use-module (gnu packages compression) + #:use-module (gnu packages crates-graphics) #:use-module (gnu packages crates-io) #:use-module (gnu packages cross-base) #:use-module (gnu packages crypto) @@ -107,6 +109,7 @@ (define-module (gnu packages admin) #:use-module (gnu packages elf) #:use-module (gnu packages file) #:use-module (gnu packages flex) + #:use-module (gnu packages fonts) #:use-module (gnu packages freedesktop) #:use-module (gnu packages gawk) #:use-module (gnu packages gettext) @@ -5192,6 +5195,74 @@ (define-public greetd-pam-mount auto-(mounting/unmounting) of XDG_RUNTIME_DIR in the way that it will not interfere with default pam-mount configuration."))) +(define-public wlgreet + (package + (name "wlgreet") + (version "0.4") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://git.sr.ht/~kennylevinsen/wlgreet") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "00grp63n9nrgqls3knxfv9wjbc7p0jwr7i2vzxy750dz85gi2kzn")))) + (build-system cargo-build-system) + (arguments + (list #:cargo-inputs + `(("rust-chrono" ,rust-chrono-0.4) + ("rust-getopts" ,rust-getopts-0.2) + ("rust-greetd-ipc" ,rust-greetd-ipc-0.8) + ("rust-lazy-static" ,rust-lazy-static-1) + ("rust-memmap2" ,rust-memmap2-0.3) + ("rust-nix" ,rust-nix-0.15) + ("rust-os-pipe" ,rust-os-pipe-0.8) + ("rust-rusttype" ,rust-rusttype-0.7) + ("rust-serde" ,rust-serde-1) + ("rust-smithay-client-toolkit" + ,rust-smithay-client-toolkit-0.15) + ("rust-toml" ,rust-toml-0.5) + ("rust-wayland-client" ,rust-wayland-client-0.29) + ("rust-wayland-protocols" ,rust-wayland-protocols-0.29) + ("rust-xml-rs" ,rust-xml-rs-0.8)) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'remove-bundled-fonts + (lambda _ + (delete-file-recursively "fonts"))) + (add-after 'remove-bundled-fonts 'fix-font-references + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "src/draw.rs" + (("\\.\\./fonts/dejavu/DejaVuSansMono\\.ttf" _) + (search-input-file + inputs + "share/fonts/truetype/DejaVuSansMono.ttf")) + (("\\.\\./fonts/Roboto-Regular\\.ttf" _) + (search-input-file + inputs + "share/fonts/truetype/Roboto-Regular.ttf"))))) + (add-after 'configure 'fix-library-references + (lambda* (#:key inputs vendor-dir #:allow-other-keys) + (substitute* (find-files vendor-dir "\\.rs$") + (("lib(wayland-.*|xkbcommon)\\.so" so-file) + (search-input-file + inputs + (string-append "lib/" so-file))))))))) + (inputs + (list font-dejavu + font-google-roboto + libxkbcommon + wayland)) + (home-page "https://git.sr.ht/~kennylevinsen/wlgreet") + (synopsis "Bare-bones Wayland-based greeter for @command{greetd}") + (description + "@command{wlgreet} provides a @command{greetd} greeter +that runs on a Wayland compositor such as @command{sway}. It +is implemented with pure Wayland APIs, so it does not depend +on a GUI toolkit.") + (license license:gpl3))) + (define-public libseat (package (name "libseat") -- 2.37.3 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 10 16:30:48 2022 Received: (at 57721) by debbugs.gnu.org; 10 Sep 2022 20:30:48 +0000 Received: from localhost ([127.0.0.1]:40428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oX77o-00049g-0a for submit@debbugs.gnu.org; Sat, 10 Sep 2022 16:30:48 -0400 Received: from knopi.disroot.org ([178.21.23.139]:34586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oX77g-000491-JQ for 57721@debbugs.gnu.org; Sat, 10 Sep 2022 16:30:44 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id EB11341663; Sat, 10 Sep 2022 22:30:39 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MlnIYjas7IWf; Sat, 10 Sep 2022 22:30:38 +0200 (CEST) From: "(" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662841836; bh=fbyjRm10NslwDSgr2z0pbFATbkKg4Y2uLjcrw1nMV7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XYdWSYJ9tzbaqOLT2f6JLUK5OzhS20w/Q/5DJ1hh/+XfjabuywjlwISOYubBZDJ9p 1+ctagdUQhgdgc/39GCD0oAwAQDpEzz+pBZxClJP/7q8edtCPYvzpsFQZPkPI5XNq6 V0OUE81cbW6zu+86lV391UkhFrTaEpfMYDKvR4U8dc1DJdBVt/Bp8irlSAIjRuGo1I 0DZ054kSI2VHPwIICidCmE9kKYLK1Iw8ZOZGoqarGCauJ6degBPb1d5dNsuNl03uBI MazRLKPF3fkJevmZ5ZMZiigfpnfx0RLX8uO42wYHWAQ0wvVm1THpUqDNeQSj071wk1 ue7T5cg6QHdAQ== To: 57721@debbugs.gnu.org Subject: [PATCH 4/4] gnu: base: Add greetd-wlgreet-sway-session. Date: Sat, 10 Sep 2022 21:30:32 +0100 Message-Id: <20220910203032.17699-4-paren@disroot.org> In-Reply-To: <20220910203032.17699-1-paren@disroot.org> References: <20220910203032.17699-1-paren@disroot.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 57721 Cc: "\(" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * gnu/services/base.scm (greetd-wlgreet-session): New data type. (greetd-wlgreet-sway-session): Likewise. * doc/guix.texi ("Base Services")[greetd-service-type]: Document them. --- doc/guix.texi | 76 ++++++++++++++++++++++++++ gnu/services/base.scm | 122 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index c21235f28d..cf66014d8e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -106,6 +106,7 @@ Copyright @copyright{} 2022 Philip M@sup{c}Grath@* Copyright @copyright{} 2022 Karl Hallsby@* Copyright @copyright{} 2022 Justin Veilleux@* Copyright @copyright{} 2022 Reily Siegel@* +Copyright @copyright{} 2022 (@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -18633,6 +18634,81 @@ are set right after mentioned variables, so that they can be overriden. @end table @end deftp +@deftp {Data Type} greetd-wlgreet-session +Generic configuration record for the wlgreet greetd greeter. + +@table @asis +@item @code{wlgreet} (default: @code{wlgreet}) +The package with the @command{/bin/wlgreet} command. + +@item @code{command} (default: @code{(file-append sway "/bin/sway")}) +Command to be started by @command{/bin/wlgreet} on successful login. + +@item @code{command-args} (default: @code{'()}) +Command arguments to pass to command. + +@item @code{output-mode} (default: @code{"all"}) +Option to use for @code{outputMode} in the TOML configuration file. + +@item @code{scale} (default: @code{1}) +Option to use for @code{scale} in the TOML configuration file. + +@item @code{background} (default: @code{(list 0 0 0 0.9)}) +RGBA list to use as the background colour of the login prompt. + +@item @code{headline} (default: @code{(list 1 1 1 1)}) +RGBA list to use as the headline colour of the UI popup. + +@item @code{prompt} (default: @code{(list 1 1 1 1)}) +RGBA list to use as the prompt colour of the UI popup. + +@item @code{prompt-error} (default: @code{(list 1 1 1 1)}) +RGBA list to use as the error colour of the UI popup. + +@item @code{border} (default: @code{(list 1 1 1 1)}) +RGBA list to use as the border colour of the UI popup. + +@item @code{extra-env} (default: @code{'()}) +Extra environment variables to set on login. + +@end table +@end deftp + +@deftp {Data Type} greetd-wlgreet-sway-session +Sway-specific configuration record for the wlgreet greetd greeter. + +@table +@item @code{wlgreet-session} (default: @code{(greetd-wlgreet-session)}) +A @code{greetd-wlgreet-session} record for generic wlgreet configuration, +on top of the Sway-specific @code{greetd-wlgreet-sway-session}. + +@item @code{sway} (default: @code{sway}) +The package providing the @command{/bin/sway} command. + +@item @code{sway-configuration} (default: #f) +File-like object providing an additional Sway configuration file to be +prepended to the mandatory part of the configuration. + +@end table + +Here is an example of a greetd configuration that uses wlgreet and Sway: + +@lisp + (greetd-configuration + ;; We need to give the greeter user these permissions, otherwise + ;; Sway will crash on launch. + (greeter-supplementary-groups (list "video" "input" "seat")) + (terminals + (list (greetd-terminal-configuration + (terminal-vt "1") + (terminal-switch #t) + (default-session-command + (greetd-wlgreet-sway-session + (sway-configuration + (local-file "sway-greetd.conf")))))))) +@end lisp +@end deftp + @node Scheduled Job Execution @subsection Scheduled Job Execution diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 616bc42e69..5de4e0a51a 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -19,6 +19,7 @@ ;;; Copyright © 2021 muradm ;;; Copyright © 2022 Guillaume Le Vaillant ;;; Copyright © 2022 Justin Veilleux +;;; Copyright © 2022 ( ;;; ;;; This file is part of GNU Guix. ;;; @@ -66,6 +67,7 @@ (define-module (gnu services base) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) #:use-module (gnu packages linux) #:use-module (gnu packages terminals) + #:use-module ((gnu packages wm) #:select (sway)) #:use-module ((gnu build file-systems) #:select (mount-flags->bit-mask swap-space->flags-bit-mask)) @@ -231,6 +233,8 @@ (define-module (gnu services base) greetd-configuration greetd-terminal-configuration greetd-agreety-session + greetd-wlgreet-session + greetd-wlgreet-sway-session %base-services)) @@ -2869,6 +2873,122 @@ (define (make-greetd-agreety-session-command config command) "agreety-command" #~(execl #$agreety #$agreety "-c" #$command)))) +(define-record-type* + greetd-wlgreet-session make-greetd-wlgreet-session + greetd-wlgreet-session? + (wlgreet greetd-wlgreet (default wlgreet)) + (command greetd-wlgreet-command + (default (file-append sway "/bin/sway"))) + (command-args greetd-wlgreet-command-args (default #~(list))) + (output-mode greetd-wlgreet-output-mode (default "all")) + (scale greetd-wlgreet-scale (default 1)) + (background greetd-wlgreet-background (default (list 0 0 0 0.9))) + (headline greetd-wlgreet-headline (default (list 1 1 1 1))) + (prompt greetd-wlgreet-prompt (default (list 1 1 1 1))) + (prompt-error greetd-wlgreet-prompt-error (default (list 1 1 1 1))) + (border greetd-wlgreet-border (default (list 1 1 1 1))) + (extra-env greetd-wlgreet-extra-env (default #~(list)))) + +(define (greetd-wlgreet-wayland-session-command session) + (program-file "wlgreet-session-command" + #~(let* ((username (getenv "USER")) + (useruid (number->string + (passwd:uid (getpwuid username)))) + (command #$(greetd-wlgreet-command session))) + (use-modules + (ice-9 format) + (ice-9 match)) + (setenv "XDG_SESSION_TYPE" "wayland") + (setenv "XDG_RUNTIME_DIR" + (string-append "/run/user/" useruid)) + (for-each (match-lambda + ((var . val) + (setenv var val))) + #$(greetd-wlgreet-extra-env session)) + (apply execl command command + #$(greetd-wlgreet-command-args session))))) + +(define (make-wlgreet-config-color section-name color) + (match color + ((red green blue opacity) + (string-append + "[" section-name "]\n" + "red = " (number->string red) "\n" + "green = " (number->string green) "\n" + "blue = " (number->string blue) "\n" + "opacity = " (number->string opacity) "\n")))) + +(define (make-wlgreet-configuration-file session) + (let ((command (greetd-wlgreet-wayland-session-command session)) + (output-mode (greetd-wlgreet-output-mode session)) + (scale (greetd-wlgreet-scale session)) + (background (greetd-wlgreet-background session)) + (headline (greetd-wlgreet-headline session)) + (prompt (greetd-wlgreet-prompt session)) + (prompt-error (greetd-wlgreet-prompt-error session)) + (border (greetd-wlgreet-border session))) + (mixed-text-file "wlgreet.toml" + "command = \"" command "\"\n" + "outputMode = \"" output-mode "\"\n" + "scale = " (number->string scale) "\n" + (apply string-append + (map (match-lambda + ((section-name . color) + (make-wlgreet-config-color section-name color))) + `(("background" . ,background) + ("headline" . ,headline) + ("prompt" . ,prompt) + ("prompt-error" . ,prompt-error) + ("border" . ,border))))))) + +(define-record-type* + greetd-wlgreet-sway-session make-greetd-wlgreet-sway-session + greetd-wlgreet-sway-session? + (wlgreet-session greetd-wlgreet-sway-session-wlgreet-session ; + (sway-configuration greetd-wlgreet-sway-session-sway-configuration ;file-like + (default #f))) + +(define (make-wlgreet-sway-configuration-file session) + (let* ((wlgreet-session (greetd-wlgreet-sway-session-wlgreet-session session)) + (wlgreet-config (make-wlgreet-configuration-file wlgreet-session)) + (wlgreet (file-append (greetd-wlgreet wlgreet-session) "/bin/wlgreet")) + (sway-config (greetd-wlgreet-sway-session-sway-configuration session)) + (swaymsg (file-append (greetd-wlgreet-sway-session-sway session) + "/bin/swaymsg"))) + (mixed-text-file "wlgreet-sway.conf" + (if sway-config + #~(string-append "include " #$sway-config "\n") + "") + "xwayland disable\n" + "exec \"" wlgreet " --config " wlgreet-config "; " + swaymsg " exit\"\n"))) + +(define (greetd-wlgreet-sway-session-command session) + (program-file "wlgreet-sway-session-command" + #~(let* ((sway #$(file-append (greetd-wlgreet-sway-session-sway session) + "/bin/sway")) + (config #$(make-wlgreet-sway-configuration-file session)) + (log-file (open-output-file + (string-append "/tmp/sway-greeter." + (number->string (getpid)) + ".log"))) + (username (getenv "USER")) + (useruid (number->string (passwd:uid (getpwuid username))))) + + ;; redirect stdout/err to log-file + (dup2 (fileno log-file) 1) + (dup2 1 2) + + ;; XXX: If we start sway immediately, it won't find seatd for some + ;; reason... + (sleep 1) + + (setenv "XDG_RUNTIME_DIR" (string-append "/run/user/" useruid)) + (execl sway sway "-d" "-c" config)))) + + (define (make-greetd-default-session-command config-or-command) (cond ((greetd-agreety-session? config-or-command) (cond ((greetd-agreety-xdg-env? config-or-command) @@ -2879,6 +2999,8 @@ (define (make-greetd-default-session-command config-or-command) (make-greetd-agreety-session-command config-or-command (greetd-agreety-tty-session-command config-or-command))))) + ((greetd-wlgreet-sway-session? config-or-command) + (greetd-wlgreet-sway-session-command config-or-command)) (#t config-or-command))) (define-record-type* -- 2.37.3 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 11 04:02:18 2022 Received: (at 57721) by debbugs.gnu.org; 11 Sep 2022 08:02:19 +0000 Received: from localhost ([127.0.0.1]:40673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXHv0-0004Gf-FN for submit@debbugs.gnu.org; Sun, 11 Sep 2022 04:02:18 -0400 Received: from knopi.disroot.org ([178.21.23.139]:53152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXHuw-0004GF-6w for 57721@debbugs.gnu.org; Sun, 11 Sep 2022 04:02:16 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id AD70A4A04E; Sun, 11 Sep 2022 10:02:12 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dJRTc2P19v1P; Sun, 11 Sep 2022 10:02:11 +0200 (CEST) From: "(" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662883331; bh=9gxHPnsZJa+LdDcaMvNMK3N5+11B9TfHh+uZvFGg5zI=; h=From:To:Cc:Subject:Date; b=IBTCW35u1i4uVaPDFaRcpRmQ4S/T805fUySCTBhJmUwBf4o1oRqRazkZMDUc3JnPy cVS0Qdvtls++0ZuuJXwNxNr/hKCfX7EPmKG8znyrm+YQn2aNET0iLGGgIntDtBICyt FZc3bkVChgyOl5yQzyYPwsoDFqUabs2t9g6a3gyR5O+4wFbzGxVpgBUCpgqu/4y8GG wodIl9XkzZWgwrllLucK+UPcgFt94uGGG/IfB1X3zNGcqzmMcunxep2IMeNgu/8dZE CQiDRhHV+OU3mPqRw+SEDzOaaFArvYmAN9NChZ1HS1KhgS8LIlGzn9aA3wlUl0FDnS 6mdZ2hhoxo89g== To: 57721@debbugs.gnu.org Subject: [PATCH v2 1/4] gnu: Add rust-greetd-ipc-0.8. Date: Sun, 11 Sep 2022 09:02:03 +0100 Message-Id: <20220911080206.31115-1-paren@disroot.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 57721 Cc: "\(" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * gnu/packages/crates-io.scm (rust-greetd-ipc-0.8): New variable. --- gnu/packages/crates-io.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index 02f7bc7d4d..c7b971ffc2 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -28,6 +28,7 @@ ;;; Copyright © 2022 Marius Bakke ;;; Copyright © 2022 Evgenii Lepikhin ;;; Copyright © 2022 Gabriel Arazas +;;; Copyright © 2022 ( ;;; ;;; This file is part of GNU Guix. ;;; @@ -26136,6 +26137,32 @@ (define-public rust-goblin-0.0 loading crate.") (license license:expat))) +(define-public rust-greetd-ipc-0.8 + (package + (name "rust-greetd-ipc") + (version "0.8.0") + (source (origin + (method url-fetch) + (uri (crate-uri "greetd-ipc" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1dscriv3adjyaxfaax3cmqrzx6q2vwwchbh86dhll783wjc4ivw0")))) + (build-system cargo-build-system) + (arguments + (list #:cargo-inputs + `(("rust-async-trait" ,rust-async-trait-0.1) + ("rust-serde" ,rust-serde-1) + ("rust-serde-json" ,rust-serde-json-1) + ("rust-thiserror" ,rust-thiserror-1) + ("rust-tokio" ,rust-tokio-1)))) + (home-page "https://kl.wtf/projects/greetd") + (synopsis "@command{greetd} IPC protocol library for Rust") + (description + "This package provides library that helps you use the +@command{greetd} JSON-based IPC protocol from Rust.") + (license license:gpl3))) + (define-public rust-grep-0.2 (package (name "rust-grep") -- 2.37.3 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 11 04:02:19 2022 Received: (at 57721) by debbugs.gnu.org; 11 Sep 2022 08:02:19 +0000 Received: from localhost ([127.0.0.1]:40675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXHv0-0004Gj-UU for submit@debbugs.gnu.org; Sun, 11 Sep 2022 04:02:19 -0400 Received: from knopi.disroot.org ([178.21.23.139]:53426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXHux-0004GJ-BS for 57721@debbugs.gnu.org; Sun, 11 Sep 2022 04:02:17 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id D4B7449FF9; Sun, 11 Sep 2022 10:02:14 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q9vvUCzkoeJ1; Sun, 11 Sep 2022 10:02:13 +0200 (CEST) From: "(" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662883331; bh=b6IqmkhbmAX9/nNvFD/UbuMvQ9XAH9T0qh8+vFKL2ME=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fjQ2QdNJK8uIGeSKur8W9oSbY4Os7hADGwquyvFEgK8KdudrHhAsMBjjtNw8+rbYq muz9tX5t04g59htjjRCd3DvQWvken9ev7VEN3uBPXhasa5Ik1BulzovpNdIG/YvENH ydNa1LohmFjCXHVgbOPVk78zFQ4TE/4LqzrGvwy6QJlYa4FPqBtrWJdM7KsEXGXlvU rBsKX9HtLnfU+jV8DCIe0aWigQtcR4BfcveUz124LIdIyOmSp58/frEHT90VgvpMog ou2VUPucUVHgWu9xrvqW7s8N3YnruXD1T/mU7VQhLjiqMjZC/ICAtPtFgrSbyitEWL 85jPUBJerlh6w== To: 57721@debbugs.gnu.org Subject: [PATCH v2 3/4] gnu: Add wlgreet. Date: Sun, 11 Sep 2022 09:02:05 +0100 Message-Id: <20220911080206.31115-3-paren@disroot.org> In-Reply-To: <20220911080206.31115-1-paren@disroot.org> References: <20220911080206.31115-1-paren@disroot.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 57721 Cc: "\(" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * gnu/packages/admin.scm (wlgreet): New variable. --- gnu/packages/admin.scm | 71 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 21f9176bfa..bf76d3bd30 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -51,6 +51,7 @@ ;;; Copyright © 2021 Artyom V. Poptsov ;;; Copyright © 2022 Wamm K. D. ;;; Copyright © 2022 Roman Riabenko +;;; Copyright © 2022 ( ;;; ;;; This file is part of GNU Guix. ;;; @@ -97,6 +98,7 @@ (define-module (gnu packages admin) #:use-module (gnu packages c) #:use-module (gnu packages check) #:use-module (gnu packages compression) + #:use-module (gnu packages crates-graphics) #:use-module (gnu packages crates-io) #:use-module (gnu packages cross-base) #:use-module (gnu packages crypto) @@ -107,6 +109,7 @@ (define-module (gnu packages admin) #:use-module (gnu packages elf) #:use-module (gnu packages file) #:use-module (gnu packages flex) + #:use-module (gnu packages fonts) #:use-module (gnu packages freedesktop) #:use-module (gnu packages gawk) #:use-module (gnu packages gettext) @@ -5192,6 +5195,74 @@ (define-public greetd-pam-mount auto-(mounting/unmounting) of XDG_RUNTIME_DIR in the way that it will not interfere with default pam-mount configuration."))) +(define-public wlgreet + (package + (name "wlgreet") + (version "0.4") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://git.sr.ht/~kennylevinsen/wlgreet") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "00grp63n9nrgqls3knxfv9wjbc7p0jwr7i2vzxy750dz85gi2kzn")))) + (build-system cargo-build-system) + (arguments + (list #:cargo-inputs + `(("rust-chrono" ,rust-chrono-0.4) + ("rust-getopts" ,rust-getopts-0.2) + ("rust-greetd-ipc" ,rust-greetd-ipc-0.8) + ("rust-lazy-static" ,rust-lazy-static-1) + ("rust-memmap2" ,rust-memmap2-0.3) + ("rust-nix" ,rust-nix-0.15) + ("rust-os-pipe" ,rust-os-pipe-0.8) + ("rust-rusttype" ,rust-rusttype-0.7) + ("rust-serde" ,rust-serde-1) + ("rust-smithay-client-toolkit" + ,rust-smithay-client-toolkit-0.15) + ("rust-toml" ,rust-toml-0.5) + ("rust-wayland-client" ,rust-wayland-client-0.29) + ("rust-wayland-protocols" ,rust-wayland-protocols-0.29) + ("rust-xml-rs" ,rust-xml-rs-0.8)) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'remove-bundled-fonts + (lambda _ + (delete-file-recursively "fonts"))) + (add-after 'remove-bundled-fonts 'fix-font-references + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "src/draw.rs" + (("\\.\\./fonts/dejavu/DejaVuSansMono\\.ttf" _) + (search-input-file + inputs + "share/fonts/truetype/DejaVuSansMono.ttf")) + (("\\.\\./fonts/Roboto-Regular\\.ttf" _) + (search-input-file + inputs + "share/fonts/truetype/Roboto-Regular.ttf"))))) + (add-after 'configure 'fix-library-references + (lambda* (#:key inputs vendor-dir #:allow-other-keys) + (substitute* (find-files vendor-dir "\\.rs$") + (("lib(wayland-.*|xkbcommon)\\.so" so-file) + (search-input-file + inputs + (string-append "lib/" so-file))))))))) + (inputs + (list font-dejavu + font-google-roboto + libxkbcommon + wayland)) + (home-page "https://git.sr.ht/~kennylevinsen/wlgreet") + (synopsis "Bare-bones Wayland-based greeter for @command{greetd}") + (description + "@command{wlgreet} provides a @command{greetd} greeter +that runs on a Wayland compositor such as @command{sway}. It +is implemented with pure Wayland APIs, so it does not depend +on a GUI toolkit.") + (license license:gpl3))) + (define-public libseat (package (name "libseat") -- 2.37.3 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 11 04:02:23 2022 Received: (at 57721) by debbugs.gnu.org; 11 Sep 2022 08:02:23 +0000 Received: from localhost ([127.0.0.1]:40677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXHv4-0004H3-RS for submit@debbugs.gnu.org; Sun, 11 Sep 2022 04:02:23 -0400 Received: from knopi.disroot.org ([178.21.23.139]:53278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXHuw-0004GH-9J for 57721@debbugs.gnu.org; Sun, 11 Sep 2022 04:02:17 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id A135D4010E; Sun, 11 Sep 2022 10:02:13 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EBzEtoEH_Mmu; Sun, 11 Sep 2022 10:02:12 +0200 (CEST) From: "(" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662883331; bh=juCQwbElWbmqmXiQivx3Yv4h73YCvzlTPdcpC5PJReg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ighQO6fq/Ie70RyCR42Rc+Qq26edd6Cx5izRYscDUSxW9wAZsKwZfRJgidD7MTebQ 9DHHevfW/I30Xyi08vYxzpEbZTYbXJ748PgXdibYEjSKVfC8cylKU9mkeI8/0eB/CG Hnr1yeK+uzVb1+pjRwso9zSAq6hpXjulJKVNnH6zwQ1R5Dd48zefZintyZE7ljyZc6 YZGK9sb6qV8wwnsoCpIXzFKeDAvDhi1ovLl55d3usd/8GsydF80YHwmHrjjQK+UuYb U5lb6DdiChkwRVI5oUwVRpuO7Ajq1H8n36E/RQZi9fxgaX4KwYOwSXQWgt8XsBAkLz 14DvFoLQNHK9A== To: 57721@debbugs.gnu.org Subject: [PATCH v2 2/4] gnu: Add rust-os-pipe-0.8. Date: Sun, 11 Sep 2022 09:02:04 +0100 Message-Id: <20220911080206.31115-2-paren@disroot.org> In-Reply-To: <20220911080206.31115-1-paren@disroot.org> References: <20220911080206.31115-1-paren@disroot.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 57721 Cc: "\(" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * gnu/packages/crates-io.scm (rust-os-pipe-0.8): New variable. --- gnu/packages/crates-io.scm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index c7b971ffc2..f1a84e9d22 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -40800,10 +40800,27 @@ (define-public rust-os-pipe-0.9 "04yjs1hf88jjm17g8a2lr7ibxyyg460rzbgcw9f1yzihq833y8zv")))) (native-inputs (list)))) -(define-public rust-os-pipe-0.5 +(define-public rust-os-pipe-0.8 (package (inherit rust-os-pipe-0.9) (name "rust-os-pipe") + (version "0.8.2") + (source (origin + (method url-fetch) + (uri (crate-uri "os-pipe" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "049ax8shxik7mm68r2nf7xnrcq3z3p7hz54sbrcxwywxqsjdzs41")))) + (arguments + (list #:cargo-inputs + `(("rust-nix" ,rust-nix-0.15) + ("rust-winapi" ,rust-winapi-0.3)))))) + +(define-public rust-os-pipe-0.5 + (package + (inherit rust-os-pipe-0.8) + (name "rust-os-pipe") (version "0.5.1") (source (origin -- 2.37.3 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 11 04:02:24 2022 Received: (at 57721) by debbugs.gnu.org; 11 Sep 2022 08:02:24 +0000 Received: from localhost ([127.0.0.1]:40679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXHv5-0004HA-D7 for submit@debbugs.gnu.org; Sun, 11 Sep 2022 04:02:24 -0400 Received: from knopi.disroot.org ([178.21.23.139]:53472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXHux-0004GK-L2 for 57721@debbugs.gnu.org; Sun, 11 Sep 2022 04:02:20 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 163024A004; Sun, 11 Sep 2022 10:02:15 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y-9mau7aMzLW; Sun, 11 Sep 2022 10:02:13 +0200 (CEST) From: "(" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662883332; bh=ujev8tYA/ex+1ZxXUspO0EDxNE3nBpfOMWp62AwIydg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iR5emTysgmc+UrgbvWkjURoYEgvZoPhCOXkRJgy75KiwvLFsk+aoHyeX8bGETo9zn yHHeQgKHvliJxw6+ZbpJK5nUH57f4OUHtpOxODty3kOFJQvJIPN23KsecRLAyngjFE HCx+eMQJq5toPQNeBU+2DvcuXmvfQ1oSF3JmAV1Lob8HG95dmewfikyMFEtoED5u83 RR1y5DlcUax977J122lPWHkXRK8th4irD5xiAbdFbuefL19ph4PmulTu7n/qQQsTKB fXnMmW6QaqnQuyqF2rfgVKhsSnPym/8rwy3gRZBWMtMLYaD3E7eMwqK7/1amD1I4fC N0sKv2CRnhzBw== To: 57721@debbugs.gnu.org Subject: [PATCH v2 4/4] gnu: base: Add greetd-wlgreet-sway-session. Date: Sun, 11 Sep 2022 09:02:06 +0100 Message-Id: <20220911080206.31115-4-paren@disroot.org> In-Reply-To: <20220911080206.31115-1-paren@disroot.org> References: <20220911080206.31115-1-paren@disroot.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 57721 Cc: "\(" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * gnu/services/base.scm (greetd-wlgreet-session): New data type. (greetd-wlgreet-sway-session): Likewise. * doc/guix.texi ("Base Services")[greetd-service-type]: Document them. --- doc/guix.texi | 76 +++++++++++++++++++++++++++ gnu/services/base.scm | 117 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 193 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index c21235f28d..0203685f82 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -106,6 +106,7 @@ Copyright @copyright{} 2022 Philip M@sup{c}Grath@* Copyright @copyright{} 2022 Karl Hallsby@* Copyright @copyright{} 2022 Justin Veilleux@* Copyright @copyright{} 2022 Reily Siegel@* +Copyright @copyright{} 2022 (@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -18633,6 +18634,81 @@ are set right after mentioned variables, so that they can be overriden. @end table @end deftp +@deftp {Data Type} greetd-wlgreet-session +Generic configuration record for the wlgreet greetd greeter. + +@table @asis +@item @code{wlgreet} (default: @code{wlgreet}) +The package with the @command{/bin/wlgreet} command. + +@item @code{command} (default: @code{(file-append sway "/bin/sway")}) +Command to be started by @command{/bin/wlgreet} on successful login. + +@item @code{command-args} (default: @code{'()}) +Command arguments to pass to command. + +@item @code{output-mode} (default: @code{"all"}) +Option to use for @code{outputMode} in the TOML configuration file. + +@item @code{scale} (default: @code{1}) +Option to use for @code{scale} in the TOML configuration file. + +@item @code{background} (default: @code{'(0 0 0 0.9)}) +RGBA list to use as the background colour of the login prompt. + +@item @code{headline} (default: @code{'(1 1 1 1)}) +RGBA list to use as the headline colour of the UI popup. + +@item @code{prompt} (default: @code{'(1 1 1 1)}) +RGBA list to use as the prompt colour of the UI popup. + +@item @code{prompt-error} (default: @code{'(1 1 1 1)}) +RGBA list to use as the error colour of the UI popup. + +@item @code{border} (default: @code{'(1 1 1 1)}) +RGBA list to use as the border colour of the UI popup. + +@item @code{extra-env} (default: @code{'()}) +Extra environment variables to set on login. + +@end table +@end deftp + +@deftp {Data Type} greetd-wlgreet-sway-session +Sway-specific configuration record for the wlgreet greetd greeter. + +@table @asis +@item @code{wlgreet-session} (default: @code{(greetd-wlgreet-session)}) +A @code{greetd-wlgreet-session} record for generic wlgreet configuration, +on top of the Sway-specific @code{greetd-wlgreet-sway-session}. + +@item @code{sway} (default: @code{sway}) +The package providing the @command{/bin/sway} command. + +@item @code{sway-configuration} (default: #f) +File-like object providing an additional Sway configuration file to be +prepended to the mandatory part of the configuration. + +@end table + +Here is an example of a greetd configuration that uses wlgreet and Sway: + +@lisp + (greetd-configuration + ;; We need to give the greeter user these permissions, otherwise + ;; Sway will crash on launch. + (greeter-supplementary-groups (list "video" "input" "seat")) + (terminals + (list (greetd-terminal-configuration + (terminal-vt "1") + (terminal-switch #t) + (default-session-command + (greetd-wlgreet-sway-session + (sway-configuration + (local-file "sway-greetd.conf")))))))) +@end lisp +@end deftp + @node Scheduled Job Execution @subsection Scheduled Job Execution diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 616bc42e69..16c4b1f533 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -19,6 +19,7 @@ ;;; Copyright © 2021 muradm ;;; Copyright © 2022 Guillaume Le Vaillant ;;; Copyright © 2022 Justin Veilleux +;;; Copyright © 2022 ( ;;; ;;; This file is part of GNU Guix. ;;; @@ -66,6 +67,7 @@ (define-module (gnu services base) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) #:use-module (gnu packages linux) #:use-module (gnu packages terminals) + #:use-module ((gnu packages wm) #:select (sway)) #:use-module ((gnu build file-systems) #:select (mount-flags->bit-mask swap-space->flags-bit-mask)) @@ -231,6 +233,8 @@ (define-module (gnu services base) greetd-configuration greetd-terminal-configuration greetd-agreety-session + greetd-wlgreet-session + greetd-wlgreet-sway-session %base-services)) @@ -2869,6 +2873,117 @@ (define (make-greetd-agreety-session-command config command) "agreety-command" #~(execl #$agreety #$agreety "-c" #$command)))) +(define-record-type* + greetd-wlgreet-session make-greetd-wlgreet-session + greetd-wlgreet-session? + (wlgreet greetd-wlgreet (default wlgreet)) + (command greetd-wlgreet-command + (default (file-append sway "/bin/sway"))) + (command-args greetd-wlgreet-command-args (default '())) + (output-mode greetd-wlgreet-output-mode (default "all")) + (scale greetd-wlgreet-scale (default 1)) + (background greetd-wlgreet-background (default '(0 0 0 0.9))) + (headline greetd-wlgreet-headline (default '(1 1 1 1))) + (prompt greetd-wlgreet-prompt (default '(1 1 1 1))) + (prompt-error greetd-wlgreet-prompt-error (default '(1 1 1 1))) + (border greetd-wlgreet-border (default '(1 1 1 1))) + (extra-env greetd-wlgreet-extra-env (default '()))) + +(define (greetd-wlgreet-wayland-session-command session) + (program-file "wlgreet-session-command" + #~(let* ((username (getenv "USER")) + (useruid (number->string + (passwd:uid (getpwuid username)))) + (command #$(greetd-wlgreet-command session))) + (use-modules (ice-9 match)) + (setenv "XDG_SESSION_TYPE" "wayland") + (setenv "XDG_RUNTIME_DIR" (string-append "/run/user/" useruid)) + (for-each (lambda (env) (setenv (car env) (cdr env))) + '(#$@(greetd-wlgreet-extra-env session))) + (apply execl command command + (list #$@(greetd-wlgreet-command-args session)))))) + +(define (make-wlgreet-config-color section-name color) + (match color + ((red green blue opacity) + (string-append + "[" section-name "]\n" + "red = " (number->string red) "\n" + "green = " (number->string green) "\n" + "blue = " (number->string blue) "\n" + "opacity = " (number->string opacity) "\n")))) + +(define (make-wlgreet-configuration-file session) + (let ((command (greetd-wlgreet-wayland-session-command session)) + (output-mode (greetd-wlgreet-output-mode session)) + (scale (greetd-wlgreet-scale session)) + (background (greetd-wlgreet-background session)) + (headline (greetd-wlgreet-headline session)) + (prompt (greetd-wlgreet-prompt session)) + (prompt-error (greetd-wlgreet-prompt-error session)) + (border (greetd-wlgreet-border session))) + (mixed-text-file "wlgreet.toml" + "command = \"" command "\"\n" + "outputMode = \"" output-mode "\"\n" + "scale = " (number->string scale) "\n" + (apply string-append + (map (match-lambda + ((section-name . color) + (make-wlgreet-config-color section-name color))) + `(("background" . ,background) + ("headline" . ,headline) + ("prompt" . ,prompt) + ("prompt-error" . ,prompt-error) + ("border" . ,border))))))) + +(define-record-type* + greetd-wlgreet-sway-session make-greetd-wlgreet-sway-session + greetd-wlgreet-sway-session? + (wlgreet-session greetd-wlgreet-sway-session-wlgreet-session ; + (sway-configuration greetd-wlgreet-sway-session-sway-configuration ;file-like + (default #f))) + +(define (make-wlgreet-sway-configuration-file session) + (let* ((wlgreet-session (greetd-wlgreet-sway-session-wlgreet-session session)) + (wlgreet-config (make-wlgreet-configuration-file wlgreet-session)) + (wlgreet (file-append (greetd-wlgreet wlgreet-session) "/bin/wlgreet")) + (sway-config (greetd-wlgreet-sway-session-sway-configuration session)) + (swaymsg (file-append (greetd-wlgreet-sway-session-sway session) + "/bin/swaymsg"))) + (mixed-text-file "wlgreet-sway.conf" + (if sway-config + #~(string-append "include " #$sway-config "\n") + "") + "xwayland disable\n" + "exec \"" wlgreet " --config " wlgreet-config "; " + swaymsg " exit\"\n"))) + +(define (greetd-wlgreet-sway-session-command session) + (program-file "wlgreet-sway-session-command" + #~(let* ((sway #$(file-append (greetd-wlgreet-sway-session-sway session) + "/bin/sway")) + (config #$(make-wlgreet-sway-configuration-file session)) + (log-file (open-output-file + (string-append "/tmp/sway-greeter." + (number->string (getpid)) + ".log"))) + (username (getenv "USER")) + (useruid (number->string (passwd:uid (getpwuid username))))) + + ;; redirect stdout/err to log-file + (dup2 (fileno log-file) 1) + (dup2 1 2) + + ;; XXX: If we start sway immediately, it won't find seatd for some + ;; reason... + (sleep 1) + + (setenv "XDG_RUNTIME_DIR" (string-append "/run/user/" useruid)) + (execl sway sway "-d" "-c" config)))) + + (define (make-greetd-default-session-command config-or-command) (cond ((greetd-agreety-session? config-or-command) (cond ((greetd-agreety-xdg-env? config-or-command) @@ -2879,6 +2994,8 @@ (define (make-greetd-default-session-command config-or-command) (make-greetd-agreety-session-command config-or-command (greetd-agreety-tty-session-command config-or-command))))) + ((greetd-wlgreet-sway-session? config-or-command) + (greetd-wlgreet-sway-session-command config-or-command)) (#t config-or-command))) (define-record-type* -- 2.37.3 From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 06 10:16:59 2022 Received: (at 57721) by debbugs.gnu.org; 6 Oct 2022 14:16:59 +0000 Received: from localhost ([127.0.0.1]:33028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogRgJ-000779-5Q for submit@debbugs.gnu.org; Thu, 06 Oct 2022 10:16:59 -0400 Received: from mira.cbaines.net ([212.71.252.8]:41508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogRgD-00076w-Qx for 57721@debbugs.gnu.org; Thu, 06 Oct 2022 10:16:57 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:fc93:27fb:8412:c8b7]) by mira.cbaines.net (Postfix) with ESMTPSA id 1C7C527BBE9; Thu, 6 Oct 2022 15:16:50 +0100 (BST) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 2ec41db0; Thu, 6 Oct 2022 14:16:49 +0000 (UTC) References: <20220910202903.17482-1-paren@disroot.org> User-agent: mu4e 1.8.9; emacs 28.1 From: Christopher Baines To: "(" Subject: Re: [bug#57721] [PATCH 0/4] gnu: base: Add greetd-wlgreet-sway-session. Date: Thu, 06 Oct 2022 15:13:14 +0100 In-reply-to: <20220910202903.17482-1-paren@disroot.org> Message-ID: <87y1tt2g1c.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57721 Cc: 57721@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain "( via Guix-patches" via writes: > This patchset adds support for a second greetd greeter: wlgreet. This > is my first time contributing additions to the documentation, so I > probably got something wrong there; corrections would be appreciated! > > ( (4): > gnu: Add rust-greetd-ipc-0.8. > gnu: Add rust-os-pipe-0.8. > gnu: Add wlgreet. > gnu: base: Add greetd-wlgreet-sway-session. > > doc/guix.texi | 76 +++++++++++++++++++++++ > gnu/packages/admin.scm | 71 +++++++++++++++++++++ > gnu/packages/crates-io.scm | 46 +++++++++++++- > gnu/services/base.scm | 122 +++++++++++++++++++++++++++++++++++++ > 4 files changed, 314 insertions(+), 1 deletion(-) Sorry for the delay in looking at this, I've gone ahead and pushed the new packages now. As for the service, it would be good to have a system test doing something with it, I don't know how feasible it is? I'm happy to merge it though if it works. I haven't tested it, but if someone could that would be useful. If that doesn't happen though, I'm happy to merge it anyway. If you could send the remaining patch again (to the same issue), that would be useful too. Thanks, Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmM+409fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XeQVhAAtddO56yBmmtiOgqMYB9rceRsWIMlbOCO rtwAMp+Seuuj9W3ihaSVJpWCy1Cugn+Zt7qX77UJ5Oe9n4weNKdgf0oEUGjnQUNJ 6DkS49YQ8Kig24TfeoMnkraKmP1P9gOltuFXImJjdrvaHAonoMti5m70pX8ZYWGJ ucYggU2XFzj3pXWhIaJ7h/n765h7QR/TYytJeHA1KdfEE7KIPj3D6N7i80NCYa61 RDJjrotHWZK5MLr+arTyl0kP6axNR9ba7E5U4/789XAInsz0Rg+dKJ/UwcAB5rsY CfUwJDugN8wuXYdE/t+kb9vRFe3lsD1cu+/vvRhWK67GZqKxmJC3nIoirTaAcdPK ogZXh6kMOi9Gce9BJ0Xs049yOPssm5jtHkmliVV1V4TfNOpa3p2wVv0RL4svCZUL hKw2vxPFyukhWWswyQ6bTUXfefA+Z42RAwlPoHBjujF/+T8gCBZZH1iUT7pCMZOk aamEJ2sEsOYinju2ke8Vj5x7q/jN8N9X1o3OzlvIntrE8HLsRhO+3lM0B7XsjVlh yztCq/qH/g8f15H6mIvr8qT3eBpqha1z4VS2H+T74/iAewZGlfemwq3a2V3doFZZ gceDsF9ksVlgo7Y/sdidQ4Yxi0+pBlDAQG66IKhwdHVv88icIsMFfvEBbDXCpBml xio3WK9ERHw= =JJBJ -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 06 14:30:05 2022 Received: (at 57721) by debbugs.gnu.org; 6 Oct 2022 18:30:05 +0000 Received: from localhost ([127.0.0.1]:33550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogVdF-0001Rq-1I for submit@debbugs.gnu.org; Thu, 06 Oct 2022 14:30:05 -0400 Received: from knopi.disroot.org ([178.21.23.139]:35474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogVdD-0001RP-Cw for 57721@debbugs.gnu.org; Thu, 06 Oct 2022 14:30:04 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id B646C4C9C8; Thu, 6 Oct 2022 20:29:50 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with UTF8SMTP id pNukRxj1XNtK; Thu, 6 Oct 2022 20:29:49 +0200 (CEST) Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1665080499; bh=UzJiYa7CQNzboG6TLFQ5P1RYAG7f+0/pSRaKQIcqYSA=; h=Date:Cc:Subject:From:To:References:In-Reply-To; b=fppwdG3WD6AwXWLM3y6sj7DAZ3W8mv8FJVTpfwNh3rqo6gIXE3BoW12+on+eiQFkj WsdMKH7W/SQxUm6cVbw7MjFgn07IGdcnBXysr5jl4/iajbmh0IpOlLnuaLAesICHyw ZgQwL+TpxXfH9pC1LQX0w9p4cJaKCNdFp3PrNqokT0wgeEpZPLj+AduZcZn9vDSRae kB53pw2ftjeB2f9ssPk2ySGBulge3jAh8OFbvepM6JPzBmABgQR53ltX3OtY5a3MBe 6QYZNaRQx47mW4k2JfmvpNqs+RVS/3aMFkDEZXHdFP8AV+SKwUCedeWI1eFfviX+z0 zp4RORw2I6cnQ== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 06 Oct 2022 19:21:38 +0100 Message-Id: Subject: Re: [bug#57721] [PATCH 0/4] gnu: base: Add greetd-wlgreet-sway-session. From: "(" To: "Christopher Baines" References: <20220910202903.17482-1-paren@disroot.org> <87y1tt2g1c.fsf@cbaines.net> In-Reply-To: <87y1tt2g1c.fsf@cbaines.net> X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Christopher, On Thu Oct 6, 2022 at 3:13 PM BST, Christopher Baines wrote: > Sorry for the delay in looking at this, I've gone ahead and pushed the > new packages now. Thanks! :D Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 FROM_ONE_CHAR Bogus FROM name -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Debbugs-Envelope-To: 57721 Cc: 57721@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) Hi Christopher, On Thu Oct 6, 2022 at 3:13 PM BST, Christopher Baines wrote: > Sorry for the delay in looking at this, I've gone ahead and pushed the > new packages now. Thanks! :D > As for the service, it would be good to have a system test doing > something with it, I don't know how feasible it is? I have no idea either, but I suspect it's not feasible, since greetd itself doesn't have any system tests. > I'm happy to merge it though if it works. I haven't tested it, but if > someone could that would be useful. If that doesn't happen though, I'm > happy to merge it anyway. It works, I've tested it and have been using it for a while. > If you could send the remaining patch again (to the same issue), that > would be useful too. Okay, I've rebased it on the latest master and will send it independently. -- ( From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 09 14:17:00 2022 Received: (at 57721) by debbugs.gnu.org; 9 Oct 2022 18:17:01 +0000 Received: from localhost ([127.0.0.1]:44905 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oharE-0008Du-8B for submit@debbugs.gnu.org; Sun, 09 Oct 2022 14:17:00 -0400 Received: from knopi.disroot.org ([178.21.23.139]:46528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohar9-0008Dj-Dd for 57721@debbugs.gnu.org; Sun, 09 Oct 2022 14:16:59 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 0FA9A4C3FE; Sun, 9 Oct 2022 20:16:54 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with UTF8SMTP id CPD8cJAF6f8m; Sun, 9 Oct 2022 20:16:52 +0200 (CEST) From: "(" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1665339410; bh=EyFFFVbbDG56hh8BnWd5UD6V9hSRFHBbC/yVVjfbSTs=; h=From:To:Cc:Subject:Date; b=Q9LOodNyVIY4hhgOdkeMNhShvdoCaG8QW3iA/WaPTPTQMhDCkmb5wURrRWHp1XdZr VgAZCuU8Sfry30hOFol98hP74Ub4z7EfsXuo44TTjcVslAhey/YCiABw0KrMhdWKAP 2tsP04jLgrmbGmU1WrkQwisuBQvphOh1cRRDBFGnyOikbaCJ33t8Dum49Zy/tWDVCW t0uz5UkoEyv8MrWc8c9Vp1552w+A9AA2YGTCgtAYNr7IwI/wdu4YDJPXvRHgNMIAQf eahltoY6GyXZpn4zFz3xI+z9GTFkY41HhVW2HjdWSTzeWEbyxyB9+Wegsgfq6sw8Sd s8mCHgB95Cidw== To: 57721@debbugs.gnu.org Subject: [PATCH v3] gnu: base: Add greetd-wlgreet-sway-session. Date: Sun, 9 Oct 2022 19:16:46 +0100 Message-Id: <20221009181646.22436-1-paren@disroot.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/services/base.scm (greetd-wlgreet-session): New data type. (greetd-wlgreet-sway-session): Likewise. * doc/guix.texi ("Base Services")[greetd-service-type]: Document them. --- doc/guix.texi | 75 [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 FROM_ONE_CHAR Bogus FROM name -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Debbugs-Envelope-To: 57721 Cc: "\(" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) * gnu/services/base.scm (greetd-wlgreet-session): New data type. (greetd-wlgreet-sway-session): Likewise. * doc/guix.texi ("Base Services")[greetd-service-type]: Document them. --- doc/guix.texi | 75 +++++++++++++++++++++++++++++ gnu/services/base.scm | 109 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 14592142dd..d5cffc8905 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18681,6 +18681,81 @@ are set right after mentioned variables, so that they can be overriden. @end table @end deftp +@deftp {Data Type} greetd-wlgreet-session +Generic configuration record for the wlgreet greetd greeter. + +@table @asis +@item @code{wlgreet} (default: @code{wlgreet}) +The package with the @command{/bin/wlgreet} command. + +@item @code{command} (default: @code{(file-append sway "/bin/sway")}) +Command to be started by @command{/bin/wlgreet} on successful login. + +@item @code{command-args} (default: @code{'()}) +Command arguments to pass to command. + +@item @code{output-mode} (default: @code{"all"}) +Option to use for @code{outputMode} in the TOML configuration file. + +@item @code{scale} (default: @code{1}) +Option to use for @code{scale} in the TOML configuration file. + +@item @code{background} (default: @code{'(0 0 0 0.9)}) +RGBA list to use as the background colour of the login prompt. + +@item @code{headline} (default: @code{'(1 1 1 1)}) +RGBA list to use as the headline colour of the UI popup. + +@item @code{prompt} (default: @code{'(1 1 1 1)}) +RGBA list to use as the prompt colour of the UI popup. + +@item @code{prompt-error} (default: @code{'(1 1 1 1)}) +RGBA list to use as the error colour of the UI popup. + +@item @code{border} (default: @code{'(1 1 1 1)}) +RGBA list to use as the border colour of the UI popup. + +@item @code{extra-env} (default: @code{'()}) +Extra environment variables to set on login. + +@end table +@end deftp + +@deftp {Data Type} greetd-wlgreet-sway-session +Sway-specific configuration record for the wlgreet greetd greeter. + +@table @asis +@item @code{wlgreet-session} (default: @code{(greetd-wlgreet-session)}) +A @code{greetd-wlgreet-session} record for generic wlgreet configuration, +on top of the Sway-specific @code{greetd-wlgreet-sway-session}. + +@item @code{sway} (default: @code{sway}) +The package providing the @command{/bin/sway} command. + +@item @code{sway-configuration} (default: #f) +File-like object providing an additional Sway configuration file to be +prepended to the mandatory part of the configuration. + +@end table + +Here is an example of a greetd configuration that uses wlgreet and Sway: + +@lisp + (greetd-configuration + ;; We need to give the greeter user these permissions, otherwise + ;; Sway will crash on launch. + (greeter-supplementary-groups (list "video" "input" "seat")) + (terminals + (list (greetd-terminal-configuration + (terminal-vt "1") + (terminal-switch #t) + (default-session-command + (greetd-wlgreet-sway-session + (sway-configuration + (local-file "sway-greetd.conf")))))))) +@end lisp +@end deftp + @node Scheduled Job Execution @subsection Scheduled Job Execution diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 3f662f1a6c..d3e3335030 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -19,6 +19,7 @@ ;;; Copyright © 2021 muradm ;;; Copyright © 2022 Guillaume Le Vaillant ;;; Copyright © 2022 Justin Veilleux +;;; Copyright © 2022 ( ;;; ;;; This file is part of GNU Guix. ;;; @@ -71,6 +72,7 @@ (define-module (gnu services base) #:use-module ((gnu packages file-systems) #:select (bcachefs-tools exfat-utils jfsutils zfs)) #:use-module (gnu packages terminals) + #:use-module ((gnu packages wm) #:select (sway)) #:use-module ((gnu build file-systems) #:select (mount-flags->bit-mask swap-space->flags-bit-mask)) @@ -237,6 +239,8 @@ (define-module (gnu services base) greetd-configuration greetd-terminal-configuration greetd-agreety-session + greetd-wlgreet-session + greetd-wlgreet-sway-session %base-services)) @@ -2902,6 +2906,109 @@ (define (make-greetd-agreety-session-command config command) "agreety-command" #~(execl #$agreety #$agreety "-c" #$command)))) +(define-record-type* + greetd-wlgreet-session make-greetd-wlgreet-session + greetd-wlgreet-session? + (wlgreet greetd-wlgreet (default wlgreet)) + (command greetd-wlgreet-command + (default (file-append sway "/bin/sway"))) + (command-args greetd-wlgreet-command-args (default '())) + (output-mode greetd-wlgreet-output-mode (default "all")) + (scale greetd-wlgreet-scale (default 1)) + (background greetd-wlgreet-background (default '(0 0 0 0.9))) + (headline greetd-wlgreet-headline (default '(1 1 1 1))) + (prompt greetd-wlgreet-prompt (default '(1 1 1 1))) + (prompt-error greetd-wlgreet-prompt-error (default '(1 1 1 1))) + (border greetd-wlgreet-border (default '(1 1 1 1))) + (extra-env greetd-wlgreet-extra-env (default '()))) + +(define (greetd-wlgreet-wayland-session-command session) + (program-file "wlgreet-session-command" + #~(let* ((username (getenv "USER")) + (useruid (number->string + (passwd:uid (getpwuid username)))) + (command #$(greetd-wlgreet-command session))) + (use-modules (ice-9 match)) + (setenv "XDG_SESSION_TYPE" "wayland") + (setenv "XDG_RUNTIME_DIR" (string-append "/run/user/" useruid)) + (for-each (lambda (env) (setenv (car env) (cdr env))) + '(#$@(greetd-wlgreet-extra-env session))) + (apply execl command command + (list #$@(greetd-wlgreet-command-args session)))))) + +(define (make-wlgreet-config-color section-name color) + (match color + ((red green blue opacity) + (string-append + "[" section-name "]\n" + "red = " (number->string red) "\n" + "green = " (number->string green) "\n" + "blue = " (number->string blue) "\n" + "opacity = " (number->string opacity) "\n")))) + +(define (make-wlgreet-configuration-file session) + (let ((command (greetd-wlgreet-wayland-session-command session)) + (output-mode (greetd-wlgreet-output-mode session)) + (scale (greetd-wlgreet-scale session)) + (background (greetd-wlgreet-background session)) + (headline (greetd-wlgreet-headline session)) + (prompt (greetd-wlgreet-prompt session)) + (prompt-error (greetd-wlgreet-prompt-error session)) + (border (greetd-wlgreet-border session))) + (mixed-text-file "wlgreet.toml" + "command = \"" command "\"\n" + "outputMode = \"" output-mode "\"\n" + "scale = " (number->string scale) "\n" + (apply string-append + (map (match-lambda + ((section-name . color) + (make-wlgreet-config-color section-name color))) + `(("background" . ,background) + ("headline" . ,headline) + ("prompt" . ,prompt) + ("prompt-error" . ,prompt-error) + ("border" . ,border))))))) + +(define-record-type* + greetd-wlgreet-sway-session make-greetd-wlgreet-sway-session + greetd-wlgreet-sway-session? + (wlgreet-session greetd-wlgreet-sway-session-wlgreet-session ; + (default (greetd-wlgreet-session))) + (sway greetd-wlgreet-sway-session-sway (default sway)) ; + (sway-configuration greetd-wlgreet-sway-session-sway-configuration ;file-like + (default (plain-file "wlgreet-sway-config" "")))) + +(define (make-wlgreet-sway-configuration-file session) + (let* ((wlgreet-session (greetd-wlgreet-sway-session-wlgreet-session session)) + (wlgreet-config (make-wlgreet-configuration-file wlgreet-session)) + (wlgreet (file-append (greetd-wlgreet wlgreet-session) "/bin/wlgreet")) + (sway-config (greetd-wlgreet-sway-session-sway-configuration session)) + (swaymsg (file-append (greetd-wlgreet-sway-session-sway session) + "/bin/swaymsg"))) + (mixed-text-file "wlgreet-sway.conf" + "include " sway-config "\n" + "xwayland disable\n" + "exec \"" wlgreet " --config " wlgreet-config "; " + swaymsg " exit\"\n"))) + +(define (greetd-wlgreet-sway-session-command session) + (let ((sway (file-append (greetd-wlgreet-sway-session-sway session) + "/bin/sway")) + (config (make-wlgreet-sway-configuration-file session))) + (program-file "wlgreet-sway-session-command" + #~(let* ((log-file (open-output-file + (string-append "/tmp/sway-greeter." + (number->string (getpid)) + ".log"))) + (username (getenv "USER")) + (useruid (number->string (passwd:uid (getpwuid username))))) + ;; redirect stdout/err to log-file + (dup2 (fileno log-file) 1) + (dup2 1 2) + (sleep 1) ;give seatd/logind some time to start up + (setenv "XDG_RUNTIME_DIR" (string-append "/run/user/" useruid)) + (execl #$sway #$sway "-d" "-c" #$config))))) + (define (make-greetd-default-session-command config-or-command) (cond ((greetd-agreety-session? config-or-command) (cond ((greetd-agreety-xdg-env? config-or-command) @@ -2912,6 +3019,8 @@ (define (make-greetd-default-session-command config-or-command) (make-greetd-agreety-session-command config-or-command (greetd-agreety-tty-session-command config-or-command))))) + ((greetd-wlgreet-sway-session? config-or-command) + (greetd-wlgreet-sway-session-command config-or-command)) (#t config-or-command))) (define-record-type* -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 11 07:08:39 2022 Received: (at 57721-done) by debbugs.gnu.org; 11 Oct 2022 11:08:39 +0000 Received: from localhost ([127.0.0.1]:51166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oiD7n-0005L2-0b for submit@debbugs.gnu.org; Tue, 11 Oct 2022 07:08:39 -0400 Received: from mira.cbaines.net ([212.71.252.8]:41544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oiD7k-0005Kt-FX for 57721-done@debbugs.gnu.org; Tue, 11 Oct 2022 07:08:37 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:fc93:27fb:8412:c8b7]) by mira.cbaines.net (Postfix) with ESMTPSA id 8F95327BBE9; Tue, 11 Oct 2022 12:08:35 +0100 (BST) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 51cfc063; Tue, 11 Oct 2022 11:08:35 +0000 (UTC) References: <20220910202903.17482-1-paren@disroot.org> <87y1tt2g1c.fsf@cbaines.net> User-agent: mu4e 1.8.9; emacs 28.1 From: Christopher Baines To: "(" Subject: Re: [bug#57721] [PATCH 0/4] gnu: base: Add greetd-wlgreet-sway-session. Date: Tue, 11 Oct 2022 12:08:13 +0100 In-reply-to: Message-ID: <87czayaa8c.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57721-done Cc: 57721-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain "(" writes: >> If you could send the remaining patch again (to the same issue), that >> would be useful too. > > Okay, I've rebased it on the latest master and will send it independently. Thanks, I've pushed this to master now as 59911ae29442aba18bcb53233e793d8f3d264504. Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmNFTrNfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XfeuQ//edlT26Q+CPjxSMe5N39PbLb2FpI+Srlq arS/3JPvM9qpMOIqqlTAPb5PuwZtVskKjyuYgHXRI7dVJTVVEs8CYqowpfuHpjAs 2Jeh4tnfgUVQoAkqIK6zmeTd6HC3ZO7mpRmopltYkoiHoQRcVDAE3K/HrvuG+39D CwDJni6IjGwNEW0zZHUxZwJzScAIJuxg+ZGL/K1L6Ebis0qfBgdpQosrXzodSLuR XrlhMPpbqNxtlWYM9AQ1+gxFVionFDomcJ/1QK4iYyZkB+TlR0uU/0LO2ZcBjWdX t4edZ9PTOJ5EfcitYTr8wCuNWkE74JWOL7PUIru5q0RQN/bKlmssdX8CDfvVNoOt MnPIyqD5FRRP0EJFggUlyPob7EkXPyG3URByQb+RPeuLV7NRzxtVVU7AiYERGZRB Q8iodNLQH/3yzTYLlwLXo8JaTjz1/pkWs48NvjOYcnaddMMtkNciQLi9OWim1Zy/ aFYG6+XjKaga6Ib4Bkf2CEEMZUJ9+V/TQyFr7mWK8kUm1lAFya4iU9Z3unH/V39r eyyvsKi1raU6dSVEVitUdfHSLOdBpsqXKUweqgvmbywe91IyZgA+cC81G5xrc0c1 9/x6ckPSJjdlQgHeBMNIIvDh3eJFTSHD9XM88UJJ3cE16sRSYpElmdMftdQx4h26 1f4+oJKbA/k= =wuv+ -----END PGP SIGNATURE----- --=-=-=-- From unknown Tue Jun 17 20:26:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 08 Nov 2022 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator