From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id SOr+N7AsD2SrrgAASxT56A (envelope-from ) for ; Mon, 13 Mar 2023 15:01:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id wBL1N7AsD2SRPwAA9RJhRA (envelope-from ) for ; Mon, 13 Mar 2023 15:01:20 +0100 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 A10C5EDC3 for ; Mon, 13 Mar 2023 15:01:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbijX-0002XN-1q; Mon, 13 Mar 2023 10:01:03 -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 1pbijW-0002Wy-61 for guix-patches@gnu.org; Mon, 13 Mar 2023 10:01:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pbijV-0004Ou-UP for guix-patches@gnu.org; Mon, 13 Mar 2023 10:01:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pbijV-0008CE-Ok for guix-patches@gnu.org; Mon, 13 Mar 2023 10:01:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62101] [PATCH] home: services: Add xmodmap. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 Mar 2023 14:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62101 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: conses Cc: Andrew Tropin , 62101@debbugs.gnu.org Received: via spool by 62101-submit@debbugs.gnu.org id=B62101.167871602927418 (code B ref 62101); Mon, 13 Mar 2023 14:01:01 +0000 Received: (at 62101) by debbugs.gnu.org; 13 Mar 2023 14:00:29 +0000 Received: from localhost ([127.0.0.1]:35250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbiiz-00077Q-B7 for submit@debbugs.gnu.org; Mon, 13 Mar 2023 10:00:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbiix-0006og-G7 for 62101@debbugs.gnu.org; Mon, 13 Mar 2023 10:00:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbiir-0004HZ-A2; Mon, 13 Mar 2023 10:00:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=7iXUwcWMwldcJAycZWm/KopK45atzqlbxt//ShuSlg8=; b=HysJMJWpWoz4CGhQN+Rl KSmwl9SsuEX4NGd46zpQo/WnIUZLvspYvG157ZLrHqNrLap2Eec88pJ7RGxZw76ega40L8TPMyPyO EyO635Prsk9aXaJq7eFd3FqKVO2YKhJtXICYLnkKfX43b9gc9pMwMk4mDnk3vhLfjhSqko0fVIftC 2adYJW7rklmlRpXme5RlrjBFpEltJRTOFgbyX1LRQTNhXFK5FUSXnTS08j16/b7wNkM8P5MKArUpW mmp16AugYnDkBlFsrNwQP0UlfhxE0RfTXnjkE+4T40bLLsD5GalGA3ZRPuRz+lRCxpyD9QFFSbVZN 0y/bjtNNcGUutg==; Received: from [193.50.110.253] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbiiq-0002PF-So; Mon, 13 Mar 2023 10:00:21 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <867cvo9y6b.fsf@conses.eu> Date: Mon, 13 Mar 2023 15:00:17 +0100 In-Reply-To: <867cvo9y6b.fsf@conses.eu> (conses's message of "Fri, 10 Mar 2023 20:57:48 +0100") Message-ID: <87wn3k21la.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , 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 ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=HysJMJWp; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678716080; a=rsa-sha256; cv=none; b=C0GTXevoMYr84HCdz8CvlcumMz/NaWkkc3hFjwTAGe/DMroIATWkArI2O1I60z636sIyJI A4tADRJ4mNeiR+Z0l7iFhyCCiqL8bSGiVkhx5y4bJ4EGy1PeX4iQhMnFBqPBxWMrwqqRgz PTO9urKDsvdIXQKMSJRCwWxXn/xC8xJNta8lN5lS1NXZR2f6rIgAckLeqOtNGnHmJZTpyT +xtXh/wlG9WT2KMivlFmjZ4XOF5TtZx6Tyb8jWNPNs2I7NusHUpgVO6CVDGcCblhOpq8ej Ec0Ru6uhfoMuVTd6MDP7DvPQfdDg/6OZ9ol5UunIsU+EHJYIwugyh1jIAtuwtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678716080; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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=7iXUwcWMwldcJAycZWm/KopK45atzqlbxt//ShuSlg8=; b=Y8EBiStwklgjgxobLxNuDTkRkQv1fJD65yC+vT5UxqqcTWw2qQ5LIVU5Wa9RmLh2ttDUgz NDUdzq06C3mfokHeP5/VLIM440WzHNRX/owuezaQ7XZfDzPRmYwGXhSZcPAXIHCKDm2fvy AhQ4c9p9CkX0LCcZLGJB/lu5lkfzimTjXdOoFnkH540haJB5GS52AQrCTFl4KHHAZTMLNI 1kwNIz0EmWVMfGj8qufF0V4VKRd1TGE64tHtw2go4TGdeBGYEKqxr64BQDHpk0f1vJCUfz zu8XO1DrXLkIvEpwRVHDI4/vIl8oKyE/Aus/3fuU+wSCb38tXKhcbhObLdRDtQ== X-Migadu-Spam-Score: -4.12 X-Spam-Score: -4.12 X-Migadu-Queue-Id: A10C5EDC3 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=HysJMJWp; 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"; dmarc=pass (policy=none) header.from=gnu.org X-TUID: kbzt69oxEAbh Hello, This looks like a useful addition! Some comments below; maybe Andrew will bring a different perspective. conses skribis: > --- > gnu/home/services/desktop.scm | 109 ++++++++++++++++++++++++++++++++++ It=E2=80=99d be great if you could provide a ChangeLog-style commit log (yo= u can check the manual and =E2=80=98git log=E2=80=99 to see what it=E2=80=99s lik= e); if you can=E2=80=99t, we can help with that. More importantly, could you add documentation to guix.texi, similar to what is done for the other Home services? That is: a few introductory lines, an example, and the reference (data types, variables, procedures). > + (alist '()) > + "Association list of key and value pairs for the > + @code{xmodmap} configuration file. Its syntax can take something like > +the following: > + > +@example > +'((#(add mod4) . Print) > + (clear lock) > + (clear control) > + (#(keycode 66) . Control_L) > + (#(add control) . #(Control_L Control_R))) > +@end example")) I don=E2=80=99t quite get the syntax. Use of vectors is unusual in this context, I=E2=80=99d recommend against it. Regarding pairs: in some cases, the cdr is a symbol/vector, in other cases it=E2=80=99s a one-element list (as in =E2=80=98(clear lock)=E2=80=99= ). That also makes it a bit confusing to me. Perhaps we should try to make it look more consistent? WDYT? > +(define (home-xmodmap-shepherd-service config) > + (list > + (shepherd-service > + (provision '(xmodmap)) > + (start #~(make-system-constructor > + (string-join > + (list #$(file-append > + (home-xmodmap-configuration-xmodmap config) > + "/bin/xmodmap") > + #$(home-xmodmap-file config))))) > + (one-shot? #t)))) Perhaps it=E2=80=99d be useful to have a =E2=80=98stop=E2=80=99 procedure t= hat undoes that changes? In which case it wouldn=E2=80=99t be one-shot anymore. > + (define serialize-field > + (match-lambda > + ((? list? e) > + (string-join > + (map > + (lambda (x) > + (serialize-term x)) > + e) > + " ")) Just: (string-join (map serialize-term e)). > +(define home-xmodmap-service-type > + (service-type > + (name 'home-xmodmap) > + (extensions > + (list > + (service-extension > + home-profile-service-type > + home-xmodmap-profile-service) > + (service-extension > + home-xdg-configuration-files-service-type > + home-xmodmap-files-service) > + (service-extension > + home-shepherd-service-type > + home-xmodmap-shepherd-service))) > + (description "Configure @code{xmodmap} bindings and rules.") Please expand the description a bit. TIA! Ludo=E2=80=99.