From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id cPSQD7kE/2YUUwEAe85BDQ:P1 (envelope-from ) for ; Thu, 03 Oct 2024 20:55:21 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id cPSQD7kE/2YUUwEAe85BDQ (envelope-from ) for ; Thu, 03 Oct 2024 22:55:21 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=bXl0Lksk; dkim=fail ("headers rsa verify failed") header.d=nanein.fr header.s=mail header.b=CL+GuTGI; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727988921; a=rsa-sha256; cv=none; b=MpTzmQKZvCIlqV3eWUXt2UF6e4/fHPRr3byGYFcF6BNspCqmeuvFMpkQ6THGBsmoAhfmOX 2iw0WAG7rRkTlgip47LMS6FOI6UWrfyyf8kE/Qm3gg7WJ7Jd1TyM+SUAvRhSIvE1mXFF8X T+8w7AyqFp2DuhtPBceGxsb3emA/IKNpvZqJgZA6/8Kyo32spB5KLYYKLwRi+Zb085kjOq zHQcI99hLZi83YRTcq3d73ZMtnwXSTZ2TW3IWeizi24FFsBNknY7qVqnRA+L487MxVd6TC Dbc/bWQnKbm7+Gulz196z9P2NBK4zeKjZlO3Lk/EsqZUtg2UbT3+MjIZG6k27g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=bXl0Lksk; dkim=fail ("headers rsa verify failed") header.d=nanein.fr header.s=mail header.b=CL+GuTGI; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727988921; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc: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=3U15PJGpcp+ERnh0eb0Dy4MYa67jN4LdFIb5Q4U1lOU=; b=lU+cb+xnp5D3WuLT4oNB969R8i0QrOPCBDG2OlX3BL8c5U7SurOIpmRnUyiDHrpckfyxp6 gnv4hqiDXy78Z3Z5bM8opb392W/SZsnSA+VJ7WZkPIyqw71vDALfHUrV07xJZkbPpaqc0w AZhuR/+lCmWMgHUq9w6EzyZPuWrQGlGPnW70pQdKQIL2qW5tk0ZsYMc+RB+DDsvrUVRo3X /gG6KpkzDnX869enf6g8H28XDkm51zJXxsJBZuf5ECcH9k/Op4ygJR7ZhSf+hEvM+V8BTq TDfARFhx/N3ZmaDeDT0IDkkh9ZK1PfinfvGNaO2vAy8jW7t3xN2EASZJkMTe5w== 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 0B22633CAC for ; Thu, 03 Oct 2024 22:55:19 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swSqj-00063k-Qd; Thu, 03 Oct 2024 16:55:02 -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 1swSqi-00063Y-9f for guix-patches@gnu.org; Thu, 03 Oct 2024 16:55:00 -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 1swSqi-0007fK-15 for guix-patches@gnu.org; Thu, 03 Oct 2024 16:55:00 -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=3U15PJGpcp+ERnh0eb0Dy4MYa67jN4LdFIb5Q4U1lOU=; b=bXl0LkskMomckG1XgN/bDWDr3uNY+gPtDUXRxOugbFhl+onERNOq/JZl4HBXwKKtKKDKXmCkjGm6A6t1QElgJ3z7KC2SFRCHiiD83Psm6sGZ6CJkGJDSNtdjvLsCWMwTr26u37XsYtEAt0m4LG3DUA76IrjfSb4NDarBFcQsM384hHElMOKPazauDBCwCAo+ErmEnv8ytQvx8McMLuv49VnNtRy4aCOv+C9fY/40os6Zx3NN5Fw1b/deUhfqgm2M5HPMSWx3++DWke/gQfd94hSs4m14O0kGNLaFZkWgENS6jyYoCMpOttzgG4x26b26iZhn+64EJccszSOYnniklw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1swSqk-0002w2-1s for guix-patches@gnu.org; Thu, 03 Oct 2024 16:55:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72714] [PATCH] home: services: Add 'home-sway-service-type'. Resent-From: Arnaud Daby-Seesaram Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Oct 2024 20:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72714 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "pelzflorian (Florian Pelz)" Cc: Hilton Chain , Ludovic =?UTF-8?Q?Court=C3=A8s?= , 72714@debbugs.gnu.org Received: via spool by 72714-submit@debbugs.gnu.org id=B72714.172798888011246 (code B ref 72714); Thu, 03 Oct 2024 20:55:02 +0000 Received: (at 72714) by debbugs.gnu.org; 3 Oct 2024 20:54:40 +0000 Received: from localhost ([127.0.0.1]:33955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swSqO-0002vK-80 for submit@debbugs.gnu.org; Thu, 03 Oct 2024 16:54:40 -0400 Received: from nanein.fr ([185.230.78.41]:40180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swSqL-0002v4-WA for 72714@debbugs.gnu.org; Thu, 03 Oct 2024 16:54:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nanein.fr; s=mail; t=1727988836; bh=YNvGSvdKSE0eGNbE+B1wz6zVgwpwD+qfEeY5nLVu+6g=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=CL+GuTGIRkR5GIQKa3Be5QuVnNfYgArdCqVZHoc5q96ZXOlxFozreINRDfk8+MlSY KY+bOw1c4Hw/2lv6BWMDfJ386g4IF37n4qdbUtosnmJqTV1AQdvpyC2ubLxCB1nWIY 7aDNwsqVa+HrJh9k7flzdYJmxY299YnZhnVmMvH3A/SFvjdna9hsc2XepBabkQVC0d 5AffZWhQBM5suNGUhg4kXcsJ6Bdl3cgVi5JOMWbZd3dyJw41foeLUgqSku85KLbIws uTRh4AHfWI/M6BIQqJ3DANozvIET8Fv2XECcsa3nf9H+dCufWB4xX/snLeny/pI+OE ja0rBps6xVPMz7ZThCpI2klYtGVm9FNJJMZPGusjDrYDbE+wMwsM8W+k2dU5qnEK5B 7h68FVGVB9tuNXSlsLQVIya7F1wNptHIksChwUIDBB4kOohmSt9LQFDAKKnzvq44GJ +NvfVGm2EKOR0er7b12/P1AF9L0HT2587xJYlz9+RMrkLN55pYOgUxHjT3qSWSo8UQ Z3jUnNxv/DBG9d1tkkqXIenU2MGgFYFXsige1TqWmWuDPqEU6yTCNYbi/YOU8F3XKM 8HB3tWvuFP4reUagS3UPri4Tb6XIHbVSl7gkVG8P6XSXSoSH0HkFJGoDQGk5FpumTL RhuiBdglCOfjyWiU99RiJ4o4= Received: from cochea (unknown [212.178.179.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by nanein.fr (Postfix) with ESMTPSA id 1E1DA140266; Thu, 3 Oct 2024 22:53:56 +0200 (CEST) In-Reply-To: <875xq9we7n.fsf@pelzflorian.de> (pelzflorian@pelzflorian.de's message of "Thu, 03 Oct 2024 14:41:48 +0200") References: <87zfno52ig.fsf@gnu.org> <20241001221313.2490-1-ds-ac@nanein.fr> <878qv6tx5i.fsf@pelzflorian.de> <87ttdu9qmo.fsf@nanein.fr> <875xq9we7n.fsf@pelzflorian.de> Date: Thu, 03 Oct 2024 22:53:42 +0200 Message-ID: <877caoewmh.fsf@nanein.fr> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: , Reply-to: Arnaud Daby-Seesaram X-ACL-Warn: , Arnaud Daby-Seesaram via Guix-patches From: Arnaud Daby-Seesaram via Guix-patches via 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-Spam-Score: -3.85 X-Spam-Score: -3.85 X-Migadu-Queue-Id: 0B22633CAC X-Migadu-Scanner: mx10.migadu.com X-TUID: kACTE7pISbcr --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Florian, "pelzflorian (Florian Pelz)" writes: > Arnaud Daby-Seesaram writes: >> "pelzflorian (Florian Pelz)" 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. No worries. I think that finding a better solution now would be better (and should not delay this issue for too long). It would avoid opening a second issue and delaying/forgetting the cache problem. > 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=E2=80=99s package= s. > > However, dmenu_path=E2=80=99s 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=E2=80=99 defaults. Yes, adding dmenu would work (minus your second point). However, to rely on both wmenu and dmenu feels a little weird, especially since the latter is only used for a bash script. It seems that Sway recently switched[1] to a utility called wmenu-run (C=C2=A0program shipped with the last version of wmenu) to get rid of their dependency on dmenu. [1] https://github.com/swaywm/sway/commit/b44015578a3d53cdd9436850202d44056= 96c1f52 >>> 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. Yes, this is a good point. I also agree that using a single script for all of the menu would make it clearer and more maintainable. For both these reasons, here is a draft proposal for a script that could replace the current content of "$menu". As suggested, it uses `scandir' and only focuses on packages of the "home profile". =2D-8<---------------cut here---------------start------------->8--- (define sway-menu (computed-file "sway-menu.scm" #~(begin (use-modules (ice-9 receive) (ice-9 rdelim) (ice-9 ftw) (guix build utils)) (define (directory->files dir) (define (executable-file? f) ;; Cf. `(@@ (guix build utils) executable-file?)' for an ;; explanation of `(zero? ...)'. (and=3D> (stat f) (lambda (s) (not (or (zero? (logand (stat:mode s) #o100)) (eq? (stat:type s) 'directory)))))) (with-directory-excursion dir (scandir "." executable-file?))) (let ((path (string-append (getenv "HOME") "/.guix-home/profile/bin")) (wmenu #$(file-append wmenu "/bin/wmenu")) (swaymsg #$(file-append sway "/bin/swaymsg"))) (receive (from to pid) ((@@ (ice-9 popen) open-process) OPEN_BOTH wmenu) (for-each (lambda (c) (format to "~a~%" c)) (directory->files path)) (close to) (let ((choice (read-line from))) (close from) (waitpid pid) (execl swaymsg swaymsg "exec" (string-append path "/" choice)))))))) =2D-8<---------------cut here---------------end--------------->8--- WDYT? Best regards, =2D-=20 Arnaud --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJEBAEBCgAuFiEEMgqfJ4U0fby1t860ojLKXoMTiAwFAmb/BFYQHGRzLWFjQG5h bmVpbi5mcgAKCRCiMspegxOIDKpJD/wOCO7McVLaBLs01FSVtEcdNK8QPL6AfBxY xesl/oc/hLeLXwIW7d79dXzRgf3MfMhPKHSBLU/9Mstqwf8H1tQLmVRKEoML/6Lt vuvNbEM6l9nHIgWVbPM9NShYc9OTNaomzX4GYZPm8nz7+P8YEQ38h2exOJIFmV/Q dai0U3Y0nYsc71PiggR/yZXo+qOPjSTEzS8sPROsvSr5Cjiotwj45WX7S5xPhC+7 Udrv8t95v16FJbHceSAPwvoG3aIMUGp8iUaocBK1n5TpKgZSuIA6vOfaDwCgJCTP 0LxPmAyKsLMGR5EWo62Exabi76JkL4/kC3sx593fPehV8RcbfXAP64Nco0edihOO K9frfA9B/p6LCy3ClnkklE2dtTqB0J/9P2dykByQUn5WsKGead4/9pAOPRGJurvK xHY/eryWtauAjVwO1C/7JOzej8kSL+0gs8xUQEtYWW2lchurdtp8hd49PbI96gSB QFGrydu57DFaVl7KxyHhOCCA93ozC1l415pclkUtGiLCWUeJ71qbEXARVMhUnG3q 8nqVCh/kCZOSoyXEvMeeJh0qJMh8jIevIxANDyjcU017PeLI2TCLM+jN6laELVGn UNTFdogVC6lT5ebH6HWrD7WylXi2QZIeSuXxiD9hXIgKeOCuh+K058OCA7v0q74+ Xn8E7phxuw== =44NG -----END PGP SIGNATURE----- --=-=-=--