GNU bug report logs - #72714
[PATCH] home: services: Add 'home-sway-service-type'.

Previous Next

Package: guix-patches;

Reported by: Arnaud Daby-Seesaram <ds-ac <at> nanein.fr>

Date: Mon, 19 Aug 2024 15:33:02 UTC

Severity: normal

Tags: patch

Done: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>

Bug is archived. No further changes may be made.

Full log


Message #53 received at 72714 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Arnaud Daby-Seesaram <ds-ac <at> nanein.fr>
Cc: Hilton Chain <hako <at> ultrarare.space>, 72714 <at> debbugs.gnu.org
Subject: Re: [bug#72714] [PATCH v6] home: services: Add
 'home-sway-service-type'.
Date: Mon, 30 Sep 2024 22:07:35 +0200
Hi Arnaud,

Arnaud Daby-Seesaram <ds-ac <at> nanein.fr> skribis:

> * gnu/home/services/sway.scm: New file.
>   (home-sway-service-type): New variable.
>   (sway-configuration->file): New procedure.
>   (sway-configuration): New configuration record.
>   (sway-bar): New configuration record.
>   (sway-output): New configuration record.
>   (sway-input): New configuration record.
>   (point): New configuration record.
>   (sway-color): New configuration record.
>   (sway-border-color): New configuration record.
>   (sway-mode): New configuration record.
>   (flatten): New procedure.
> * gnu/local.mk: Add gnu/home/services/sway.scm.
> * doc/guix.texi (Sway window manager): New node to document the above changes.

I don’t use Sway myself but it looks like a welcome addition.

I trust Hilton’s comment here so here are some more superficial
comments.

> +The @code{(gnu home services sway)} module provides
> +@code{home-sway-service-type}, a home service to configure sway in a
> +declarative way.

To add more context:

“… to configure the @uref{https://github.com/swaywm/sway,Sway window
manager for Wayland} in a declarative way.”

> +@quotation Note
> +This home service only sets up the configuration file and profile
> +packages for sway.  It does @i{not} start sway in any way.  If you want

s/sway/Sway/
s/@i/@emph/

> +@defvar sway-configuration->file

Should be “@deffn {Procedure} sway-configuration->file config”.

> +Here is an example of a service and its configuration that you could add
> +to the @code{services} field of your @code{home-environment}:

I would move the example right before “@quotation Note”.

> +@item @code{always-execs} (default: @code{'()})
> +Programs to execute at startup time @i{and} after every configuration
> +reload.  The value of this field is a list of strings or G-expressions.
> +
> +@item @code{execs} (default: @code{%sway-default-execs})
> +Programs to execute at startup time.  The value of this field is a list
> +of strings or  G-expressions.

Please avoid abbreviations.  Maybe these fields could be called
‘startup+reload-programs’ and ‘startup-programs’?

> +The default value, @code{%sway-default-execs}, executes @code{swayidle}

Likewise, @code{%sway-default-startup-programs}?

> +@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
> +to @kbd{ctrl}:
> +@lisp
> +(sway-input (identifier "type:keyboard")
> +            (xkb-layout "fr")
> +            (xkb-options '("ctrl:nocaps")))
> +@end lisp

Would it be possible here to reuse the <keyboard-layout> record
documented in
<https://guix.gnu.org/manual/devel/en/html_node/Keyboard-Layout.html>?

If it’s possible, that would provide a nicely consistent interface.  If
there’s the need for an extra identifier, maybe you’ll still need
<sway-input>:

  (sway-input (identifier "type:keyboard")
              (layout (keyboard-layout "tr")))

WDYT?

> +@lisp
> +(program-file
> + "sway-bar-status"
> + (with-imported-modules
> +     (source-module-closure
> +      '((ice-9 format) (srfi srfi-19)))

‘with-imported-modules’ can be removed here because (ice-9 format) and
(srfi srfi-19) are provided by Guile itself.

That’s it for me!

Could you send updated patches?

Thank you!

Ludo’.




This bug report was last modified 220 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.