Subject: Re: [PATCH] home: services: Add 'home-sway-service-type'.

From: "pelzflorian (Florian Pelz)" <[email-masked]>
Date: Thu, 03 Oct 2024 14:41:48 +0200

Hello Arnaud.

Arnaud Daby-Seesaram <[email-masked]> writes:
> "pelzflorian (Florian Pelz)" <[email-masked]> writes:
>> Perhaps for more hackability, we could deviate from upstream and put in
>> a call to guile with a Scheme script in a computed-file that opens a
>> pipe to/from wmenu and does the same as dmenu_path without cache only on
>> ~/.guix-home/profile/bin.
>
> Yes indeed.  Do you think that the Guile script should replace all of
> "$menu", or just the dmenu_path part?
>

All of "$menu", because it looks nicer?  But I should not imply that
such deviation from upstream were necessary for getting your patch in.

Basically my issue was that dmenu_path did not work.

Indeed stest is part of the dmenu package, so when dmenu is installed to
the profile, dmenu_path would work.  So a more upstream conformant
solution would be to just add the dmenu package to sway’s packages.

However, dmenu_path’s cache means that if we used dmenu_path like
upstream, it would never recognize changes to the installed packages.
OpenBSD opted for wmenu_path which is like dmenu_path without cache
and a guile script seems more appropriate for Guix’ defaults.

> On this topic, do you know if there is a built-in way to write
> `find -maxdepth 1 ...' in Guile (without calling `readdir' manually)?

scandir from the (ice-9 ftw) module, I think.

>> only on ~/.guix-home/profile/bin.
>
> What is the rationale for restricting the menu to this directory (and
> not all directories in
>   (filter directory-exists? (string-split (getenv "PATH") #\:))
> ?
>

All my graphical applications are in the home profile and non-graphical
programs will not be used and clutter wmenu.  Do others put graphical
apps in the system profile?  Perhaps so.  But then non-graphical
coreutils would be in the wmenu as well.  Hmm I am not sure and would be
fine with either.

>> Or change the dmenu_path program with `substitute' to use the absolute
>> file-name of stest.
>
> I think that the Guile script might be simpler.
>
> By `substitute', do you mean in the package definition?

Yes, the dmenu package definition.

> This does not
> seem necessary, as people installing dmenu have stest in their profile.
>

If dmenu were installed in the sway-packages, substitute would not be needed.

> Do you want me to send a v8 with the above fixes, or should I wait until
> we change the content of the "$menu" variable?

It can wait.

Regards,
Florian