Subject: [bug#75270] [PATCH v4 2/3] gnu: Add gtkgreet.

From: muradm <[email-masked]>
Date: Tue, 28 Jan 2025 22:01:52 +0300

Hello,

Maxim Cournoyer <[email-masked]> writes:

> Hello,
>
> muradm <[email-masked]> writes:
>
>> * gnu/packages/admin.scm (gtkgreet): New variable.
>> (gtkgreet-adwaita-dark): New variable.
>
> Please split packages submission in different commits (1 package 
> = 1
> commit).
>

It is one package + variation, still split?

>> +    (build-system meson-build-system)
>> +    (native-inputs (list pkg-config scdoc))
>> +    (inputs (list gtk+ gtk-layer-shell json-c))
>> +    (synopsis "GTK based greeter for greetd")
>> +    (description
>> +     "GTK based greeter for greetd, to be run under cage or 
>> similar.")
>
> I'd spell GTK-based, despite what upstream used.

I copied and pasted what upstream says.

> What does 'to be run
> under cage' means?  What is cage?  Shouldn't that run under 
> greetd?  I'm
> confused.  Please expand the description.

While greeter is getting started by greetd, for graphical greeters 
you need some compositor. So that greetd starts compositor which 
starts the greeter. I suppose author here may refer to Cage 
wayland kiosk (guix package --show=cage) compositor as an example. 
The idea is to run greeter in such configuration that only one 
application is executed.

>> +    (home-page "https://git.sr.ht/~kennylevinsen/gtkgreet")
>> +    (license license:gpl3+)))
>> +
>> +(define-public gtkgreet-adwaita-dark
>> +  (package
>> +   (inherit gtkgreet)
>> +   (name "gtkgreet-adwaita-dark")
>> +   (arguments
>> +    (list
>> +     #:phases
>> +     #~(modify-phases
>> +        %standard-phases
>> +        (add-after 'install 'wrap-gtkgreet-for-theme
>> +                   (lambda _
>> +                     (wrap-program
>> +                      (string-append #$output "/bin/gtkgreet")
>> +                      '("GTK_THEME" "" = 
>> ("Adwaita:dark"))))))))
>
> Hm, that rebuilds gtkgreet just to change its theme?  Couldn't 
> its
> service be configurable and take care of that instead?

There is nothing usable to extract into configuration. I found it 
easier to configure package than to have alternative package 
inlined into configuration. For instance 
`<greetd-gtkgreet-sway-session>` has two fields holding packages 
`sway` and `gtkgreet`. Is there any way to specify value of 
`gtkgreet` to hold multiple packages to achieve similar effect 
wihout building package?

>> +   (inputs (modify-inputs
>> +            (package-inputs gtkgreet)
>> +            (prepend gnome-themes-extra)))))
>> +
>
> Nitpic: that'd be more conventionally indented as:
>
> --8<---------------cut 
> here---------------start------------->8---
> (inputs
>  (modify-inputs (package-inputs gtkgreet)
>   (prepend gnome-themes-extra)))
> --8<---------------cut 
> here---------------end--------------->8---

Noted.