From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id aIE+KOl1CmdhdwEA62LTzQ:P1 (envelope-from ) for ; Sat, 12 Oct 2024 13:13:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id aIE+KOl1CmdhdwEA62LTzQ (envelope-from ) for ; Sat, 12 Oct 2024 15:13:13 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=D7aar2vv; dkim=fail ("headers rsa verify failed") header.d=pelzflorian.de header.s=key2 header.b=agTNlzd7; 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=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1728738793; 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-to: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=zvUlW1Cl8sob2+jIvIaN24hMDTvYAdp5wQCXiIYKQsc=; b=DoB1Ay1Qi6fe5M87rHR0yQZL9exeypl8tOwdMChYH3oQfioz0kwZVAHsQrgX1A0ySojfLC CrMbXwVC7b7XXvd+vq1gBs+iOcF4SGpdYl9x2y4sk5fFnq6nSIWorDpfpNHxGwqgvAtVsp /JXj8btarQZBgCloUCKENRl6Ak3YQUouA8GaF7ibQWLcxkarhT002ktIGTNRK0MHkGlI1/ SeiZPlrM2MSs5UFrFRKLSVxKf5e5nYX8qDgIMqcAOPBmFzLnK67zpEOMDLeSj27vhMQ5p1 Io9pEevAK6Do9K5qjdDoVZm5UFsp8K17MBGqrqRYos9onwVA7XmHcbdjJwFvWA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=D7aar2vv; dkim=fail ("headers rsa verify failed") header.d=pelzflorian.de header.s=key2 header.b=agTNlzd7; 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=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1728738793; a=rsa-sha256; cv=none; b=NrvRpTvJxOtdOTzn0JoRbttb4zeaPw6YtEziEoTA50ismDzjvUQ1Y+/nz/exy45jdtMomo gXgcEoKPBSbVZZFPQoxS44vAdFmFG1kVQ6/7wvq5O8o9jlJTcPuXkpa9ugVstzAZNOcDhy SsTLCMkE2KEzeTnxw7wdoCFdzXTFN2/TMMrk8t3nS9b5gkRhGQ2Bcqm3Nmikox8JUUbpvO MtmQPqtm8v9qhP4iTMbXexecpzuesSACq37s0W2Dina8/Tex4NdzfGoi9dRaRi8XEcRMEE 6RRWeU7Ow5xf8ClEIcqISEnqdItlbDYxz2gsRYDQYyNgiq3D0eAm+Xlf/bbGHw== 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 204927DDB5 for ; Sat, 12 Oct 2024 15:13:13 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1szbvS-0003I3-H3; Sat, 12 Oct 2024 09:12:54 -0400 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 1szbvN-0003Hd-6o for guix-patches@gnu.org; Sat, 12 Oct 2024 09:12:50 -0400 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 1szbvM-0000Bh-Cg for guix-patches@gnu.org; Sat, 12 Oct 2024 09:12:48 -0400 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=NrSd/S9zfH1DXV8Kk6KNwwxDhjZ3nkTKPfmD6impuP0=; b=D7aar2vvvCBQ52Xu3OFa0AC1OiJ2vE6NxYrEdipAqXt8PoHiG3myuor+MRXXn1dGtYEgRpmFbFfVv30JcE25VF4KZ/wiTRixaQfV3GXZgjpgs5/QTXjwnisYURt/6PW5112jt9PgcLF8N9xCdIxo8kysk5nYdOfeS7WQ4hxQywy4qvobyb1GK66rvcquu+nBrBKQb4HcOaI4oLLbSd5gqUy6kkQjeXbqbYEMhqLMztA8w/R2lZ2SbjaXeak9TTYD4GQCRDHdVB6vLrv4JroTNX1YkiVeDlfqjmQ/dnYi2/nCQ6gkd7GZyv1U6+SLJbU4hjqFSSZK3dc0RpwVhuv9OQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1szbva-0005xV-EB for guix-patches@gnu.org; Sat, 12 Oct 2024 09:13:02 -0400 Subject: bug#72714: [PATCH v8] home: services: Add 'home-sway-service-type'. Resent-From: "pelzflorian (Florian Pelz)" Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Sat, 12 Oct 2024 13:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 72714 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Arnaud Daby-Seesaram Cc: Hilton Chain , Ludovic =?UTF-8?Q?Court=C3=A8s?= , 72714-done@debbugs.gnu.org Mail-Followup-To: 72714@debbugs.gnu.org, pelzflorian@pelzflorian.de, ds-ac@nanein.fr Received: via spool by 72714-done@debbugs.gnu.org id=D72714.172873873322820 (code D ref 72714); Sat, 12 Oct 2024 13:13:02 +0000 Received: (at 72714-done) by debbugs.gnu.org; 12 Oct 2024 13:12:13 +0000 Received: from localhost ([127.0.0.1]:43073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szbul-0005vx-V6 for submit@debbugs.gnu.org; Sat, 12 Oct 2024 09:12:12 -0400 Received: from relay.yourmailgateway.de ([188.68.63.166]:38215) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szbuj-0005vp-6Q for 72714-done@debbugs.gnu.org; Sat, 12 Oct 2024 09:12:10 -0400 Received: from mors-relay-8202.netcup.net (localhost [127.0.0.1]) by mors-relay-8202.netcup.net (Postfix) with ESMTPS id 4XQk9d3pKJz3vgr; Sat, 12 Oct 2024 15:00:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=pelzflorian.de; s=key2; t=1728738005; bh=5BJ2/zHdK+w/fmmRlvysjJyJBJx8itnobOVM+VjaCLU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=agTNlzd7kuL81zcE84CdIutuCrc5cMKsRurvyDkY4VUJZM0HibIKIHzHGyf5+dPBn 7SvUub62Nu95+eRVohFPtXRjTcgtjBCvzL085aUmuSADPEurA0EdkAzQsTHX5566B5 HKQBaYlu/swx+vzX+UK7cH+bNSAelw/2dZx09/TWNTweX9qQz0OgFoBS9LByy/yVeM LxFpldc16NuxajApo5B7Sb1OUr6lj5tGkxFwg3muKBrKeog2znsuQI9Q5BBMyqz0Cu c3T2lLc6jh68YdKJQI21auF4duRF3Fwe9UzQxoINJSC22oiYaYV2CqMk+yJsn49DIh kZY7sS1UIyGug== Received: from policy01-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-8202.netcup.net (Postfix) with ESMTPS id 4XQk9d353Sz3vgk; Sat, 12 Oct 2024 15:00:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at policy01-mors.netcup.net Received: from mxe217.netcup.net (unknown [10.243.12.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by policy01-mors.netcup.net (Postfix) with ESMTPS id 4XQkRD5HW1z8t3t; Sat, 12 Oct 2024 15:11:52 +0200 (CEST) Received: from florianhp (ipb218687b.dynamic.kabel-deutschland.de [178.24.104.123]) by mxe217.netcup.net (Postfix) with ESMTPSA id E236683EF1; Sat, 12 Oct 2024 15:11:44 +0200 (CEST) From: "pelzflorian (Florian Pelz)" In-Reply-To: <20241008223645.19674-1-ds-ac@nanein.fr> (Arnaud Daby-Seesaram's message of "Wed, 9 Oct 2024 00:33:41 +0200") References: <87cyka1rda.fsf@pelzflorian.de> <20241008223645.19674-1-ds-ac@nanein.fr> Date: Sat, 12 Oct 2024 15:11:56 +0200 Message-ID: <87iktx79er.fsf@pelzflorian.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Rspamd-Queue-Id: E236683EF1 X-Rspamd-Server: rspamd-worker-8404 X-NC-CID: NUVffUrWUkomG61wNq3aaXABgM793RxNLMe4qeR8VmYRXBfySCVtxCQB 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: 4.46 X-Spam-Score: 4.46 X-Migadu-Queue-Id: 204927DDB5 X-TUID: i82xMRaXnL9j --=-=-= Content-Type: text/plain Pushed as b64f7984a5e2aba04df72a92f0044e423efe77c6, Change-Id: I880261570c5afdb795f2ce18bac2b9a5c898677f with tiny changes. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=diff --- doc/guix.texi | 16 ++++++++-------- gnu/home/services/sway.scm | 24 ++++++++---------------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 0f45ef3b15..ddbff8bc23 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47170,13 +47170,13 @@ Sway window manager want to do so, you might be interested in using @code{greetd-wlgreet-sway-session} instead. -The function @code{sway-configuration->file} defined below can be used +The proceedure @code{sway-configuration->file} defined below can be used to provide the value for the @emph{optional} @code{sway-configuration} field of @code{greetd-wlgreet-sway-session}. @end quotation @deffn {Procedure} sway-configuration->file config -This function takes one argument @code{config}, which must be a +This procedure takes one argument @code{config}, which must be a @code{sway-configuration} record (defined below), and returns a file-like object representing the serialized configuration. @end deffn @@ -47263,11 +47263,11 @@ Sway window manager @item @code{startup+reload-programs} (default: @code{'()}) Programs to execute at startup time @emph{and} after every configuration reload. The value of this field is a list of strings, G-expressions or -file-append objects (@pxref{G-Expressions}). +file-like objects (@pxref{G-Expressions}). @item @code{startup-programs} (default: @code{%sway-default-execs}) Programs to execute at startup time. As above, values of this field are -a list of strings, G-expressions or file-append objects. +a list of strings, G-expressions or file-like objects. The default value, @code{%sway-default-execs}, executes @code{swayidle} in order to lock the screen after 5@ minutes of inactivity (displaying a @@ -47283,7 +47283,7 @@ Sway window manager @deftp {Data Type} sway-input @code{sway-input} records describe input blocks (see@ @cite{sway-input(5)}). For example, the following snippet makes all -keyboards use a french layout, in which @kbd{capslock} has been remaped +keyboards use a French layout, in which @kbd{capslock} has been remapped to @kbd{ctrl}: @lisp (sway-input (identifier "type:keyboard") @@ -47365,8 +47365,8 @@ Sway window manager the wallpaper will be displayed. It must be a symbol among @code{stretch}, @code{fill}, @code{fit}, @code{center} and @code{tile}. -If the second element is not specified (@i{i.e.}@: when the value not a -pair), the @code{fill} mode will be used. +If the second element is not specified (@i{i.e.}@: when the value is not +a pair), the @code{fill} mode will be used. @end itemize @quotation Note @@ -47444,7 +47444,7 @@ Sway window manager @item @code{colors} (optional) An optional @code{sway-color} configuration record. -@item @code{status-command} (default: @code{%sway-status-command}) +@item @code{status-command} (optional) This field accept strings, G-expressions and executable file-like values. The default value is a command (string) that prints the date and time every second. diff --git a/gnu/home/services/sway.scm b/gnu/home/services/sway.scm index 9401c80400..0e1a2d57b2 100644 --- a/gnu/home/services/sway.scm +++ b/gnu/home/services/sway.scm @@ -20,9 +20,6 @@ (define-module (gnu home services sway) #:use-module (guix modules) #:use-module (guix gexp) #:use-module (srfi srfi-1) - #:use-module (srfi srfi-26) - #:use-module (ice-9 popen) - #:use-module (ice-9 format) #:use-module (ice-9 match) #:use-module (guix packages) #:use-module (gnu system keyboard) @@ -52,7 +49,6 @@ (define-module (gnu home services sway) %sway-default-gestures %sway-default-modes %sway-default-keybindings - %sway-default-status-command %sway-default-startup-programs %sway-default-packages)) @@ -221,7 +217,7 @@ (define-configuration/no-serialization sway-bar "Color palette of the bar.") (status-command maybe-status-command - "Status command. It must be file-like.") + "Status command.") (mouse-bindings (mouse-bindings '()) "Actions triggered by mouse events.") @@ -275,7 +271,6 @@ (define-configuration/no-serialization sway-mode (mouse-bindings (mouse-bindings '()) "Mouse bindings.")) -;; TODO (not necessary for 72714): switch bindings. (define (sway-modes? lst) (every sway-mode? lst)) @@ -327,10 +322,10 @@ (define sway-menu (with-imported-modules (source-module-closure '((guix build utils))) #~(begin - (use-modules (ice-9 popen) + (use-modules (ice-9 ftw) + (ice-9 popen) (ice-9 receive) (ice-9 rdelim) - (ice-9 ftw) (guix build utils) (srfi srfi-1)) @@ -351,7 +346,7 @@ (define sway-menu "/.guix-home/profile/bin")) (wmenu #$(file-append wmenu "/bin/wmenu")) (swaymsg #$(file-append sway "/bin/swaymsg"))) - (receive (from to pid) + (receive (from to pids) (pipeline `((,wmenu))) (for-each (lambda (c) (format to "~a~%" c)) @@ -359,8 +354,8 @@ (define sway-menu (close to) (let ((choice (read-line from))) (close from) - (waitpid (first pid)) - (when (string? choice) ;do not attempty to launch if no choice + (waitpid (first pids)) + (when (string? choice) ;do not attempt to launch if no choice ;was given (e.g. if Escape is pressed in ;wmenu). (execl swaymsg swaymsg "exec" "--" @@ -464,9 +459,6 @@ (define %sway-default-keybindings ($mod+minus . "scratchpad show") ($mod+r . "mode \"resize\""))) -(define %sway-default-status-command - "while date +'%Y-%m-%d %X'; do sleep 1; done") - (define %sway-default-startup-programs (list #~(string-append @@ -751,7 +743,7 @@ (define (sway-configuration->file conf) (computed-file "sway-config" #~(begin - (use-modules (ice-9 format) (ice-9 popen) (ice-9 match) + (use-modules (ice-9 format) (ice-9 match) (srfi srfi-1)) (call-with-output-file #$output @@ -859,7 +851,7 @@ (define (sway-configuration->file conf) ;;; -;;; Definition of th Home Service. +;;; Definition of the Home Service. ;;; (define (sway-configuration->files sway-conf) -- 2.45.2 --=-=-= Content-Type: text/plain I also reindented the commit message and put a line break because the last line did not fit on my terminal. Thank you greatly! Regards, Florian --=-=-=--