Subject: [bug#72714] [PATCH v4] home: services: Add 'home-sway-service-type'.

From: "pelzflorian (Florian Pelz)" <[email-masked]>
Date: Sat, 14 Sep 2024 15:28:42 +0200

Thank you Arnaud for this well-written home-sway-service!

Some comments for you or the one who pushes your patch.  I would
rather not take any responsibility for sway myself.

> @quotation Note
> This home service only sets up configuration file and profile packages

Typo: Please add 'the': sets up the configuration file and profile packages

> The function @code{sway-configuration->file} defined below can be used
> to provide the value for the @code{sway-configuration} field of
> @code{greetd-wlgreet-sway-session}.

Good.  Even though it is a little strange that one would add a home
module (gnu home services sway) to the operating-system configuration,
I know no better place for this `sway-configuration->file' procedure,
since the record is for Guix Home and being able to use it for greetd
is just an extra feature.

> @lisp
> (define bg-file
>   (computed-file
>    "background.png"
>    #~(let* ((insvg (string-append
>                     #$guix-backgrounds
>                     "/share/backgrounds/guix/guix-checkered-16-9.svg"))
>             (out #$output)
>             (cmd (string-append
>                   #$librsvg "/bin/rsvg-convert " insvg " -o " out)))
>        (system cmd))))
> 
> (service home-sway-service-type
>          (sway-configuration
>           (gestures
>            '((swipe:3:down . "move to scratchpad")
>              (swipe:3:up   . "scratchpad show")))
>           (outputs
>            (list (sway-output
>                   (identifier '*)
>                   (bg bg-file))))))
> @end lisp

Why not (bg #~(file-append #$guix-backgrounds
                     "\
/share/backgrounds/guix/guix-checkered-16-9.svg"))
?  This does not work right now, but could you change bg and
perhaps status-command to accept gexps?

> swiping down (resp.@ up) with three fingers moves the active window to
> the scratchpad (resp.@ shows/hides the scratchpad).

Should be with a colon: resp.@: up

You should run untabify on all of  gnu/home/services/sway.scm
to get rid of nasty tabs.

Otherwise looks really good to me (although I have not cross-checked
the man pages).

Regards,
Florian