From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id CEJPFr4WE2SSRAAASxT56A (envelope-from ) for ; Thu, 16 Mar 2023 14:16:46 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qNpTFb4WE2QqSAAAG6o9tA (envelope-from ) for ; Thu, 16 Mar 2023 14:16:46 +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 1B5EF12245 for ; Thu, 16 Mar 2023 14:16:45 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=conses.eu header.s=gm1 header.b=ZuYu0GGS; dmarc=none; 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=1678972606; 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=JaMgJF5+wwrSf5VciuzwW5gY/MMPhK+aFB5jY+4Oh0Y=; b=VbW/QLLoH/a7pyFSMMy9cBHpRJWCWiJIY0XSEMA7iXIMroiGoJncmP96Rl7GOoaz43JnfH 7L8zEkcJiIW8978wFgD8o/SDQQa94pJ/MiXZnyrQyvIowZWEEEJxlQdLNDrim5007gVPT2 quvn26kUyeTmmKCQhGVHxQUkoANa3VJWbf0bT0AkOU22LYqx9+7F9N+bTS1LEyoN9ad6Bo ZKJvPHvaU5WYGFfNEpQi5Ii5Uy3REkF5zEdurl+fg8R5gxBULn0IBFtmcPGCAh5YRJNS57 jtx6ggBl6y64oCjqlg3fnXeJQcmxrVlsa56uxMdBGisjjSPnryZx+duSMxFX7g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=conses.eu header.s=gm1 header.b=ZuYu0GGS; dmarc=none; 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=1678972606; a=rsa-sha256; cv=none; b=uBLNx00u19sWsNpF93Uds2qY/9YEIeFbPpLznHc4gEJsD7H4ZTyZ7YlpRkfIf7i/feSs9I m3Lx+TfAV1y7DmRZ/UnL/TV6DKZzEj2TfrOYApdPZqXTOamkdya3nB2csIrVcN5G6Art+U Ck+sdEYD0iQ5QY7NCeKnrQRtRQgRnYb946CU1w3fdqYiKbRxB3qq6Jo7BnndsIyzoTw7BM 0sN5zy2XOyNkaCd38JSMDuSUIUDsS+l3phP1wfPgH9EPOKJkU2CqiMQ02PSvNTRqB7pcxd c9dtKHqsd2bsaHOAf+JihBtjof+P9Up1jaP0EESUW93Fj3pgCfwpl1bmqgA7AA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcnSo-0000Zh-HA; Thu, 16 Mar 2023 09:16:14 -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 1pcnSd-0000Ys-53 for guix-patches@gnu.org; Thu, 16 Mar 2023 09:16:05 -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 1pcnSc-0007QH-Dn for guix-patches@gnu.org; Thu, 16 Mar 2023 09:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pcnSc-0007kI-04 for guix-patches@gnu.org; Thu, 16 Mar 2023 09:16:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62101] [PATCH] home: services: Add xmodmap. Resent-From: conses Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Mar 2023 13:16: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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: contact@conses.eu, 62101@debbugs.gnu.org Received: via spool by 62101-submit@debbugs.gnu.org id=B62101.167897254329745 (code B ref 62101); Thu, 16 Mar 2023 13:16:01 +0000 Received: (at 62101) by debbugs.gnu.org; 16 Mar 2023 13:15:43 +0000 Received: from localhost ([127.0.0.1]:41472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pcnSI-0007jg-GH for submit@debbugs.gnu.org; Thu, 16 Mar 2023 09:15:42 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:46181) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pcnSG-0007jU-D9 for 62101@debbugs.gnu.org; Thu, 16 Mar 2023 09:15:41 -0400 Received: (Authenticated sender: contact@conses.eu) by mail.gandi.net (Postfix) with ESMTPSA id CCBE4240007; Thu, 16 Mar 2023 13:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conses.eu; s=gm1; t=1678972534; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=JaMgJF5+wwrSf5VciuzwW5gY/MMPhK+aFB5jY+4Oh0Y=; b=ZuYu0GGSiQyXT8B/i+sgOXLy4/z+zBbKVPAhgN6zs9L/a7k+UkgLoUWe+VRuJlmeprktfg xipup0SOw4/K37I5B0cOCwU27Tdig5tPrJfctXNjQ6BAwkWtbLTp5WRlQW9INQWwU66+lT bpkIg/Ju+MQNi01gLzcO9qBnsZ+wioxlkjom6UPYH4Mec6iEe0Ks7N+mAYRtIhhyoekdPB AGtgYOyESjduIyq55iB+2PxCsHX7SCLuyhvZZaktWedPD+NaRwjamptsYzNisiuPce8d9L AwGp97otJCshZklQnm2HoeN8WdIMey/AWTXRrmmPk+HOugtnwUYO5ziXMVqtFw== From: conses In-Reply-To: <87wn3k21la.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 13 Mar 2023 15:00:17 +0100") References: <867cvo9y6b.fsf@conses.eu> <87wn3k21la.fsf@gnu.org> Date: Thu, 16 Mar 2023 14:15:32 +0100 Message-ID: <86a60cx2ff.fsf@conses.eu> User-Agent: Gnus/5.13 (Gnus v5.13) 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: X-Migadu-Queue-Id: 1B5EF12245 X-Spam-Score: -3.04 X-Migadu-Spam-Score: -3.04 X-Migadu-Scanner: scn0.migadu.com 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 X-TUID: D57yDHFJEk4G Ludovic Court=C3=A8s writes: > It=E2=80=99d be great if you could provide a ChangeLog-style commit log (= you can > check the manual and =E2=80=98git log=E2=80=99 to see what it=E2=80=99s l= ike); if you can=E2=80=99t, we > can help with that. > Apologies for missing this, I added it in v2. > 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). > Likewise. >> + (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? I've amended the type of config to be of list instead. As I've hinted in the manual, the motivation for including vectors and lists is to provide a more Lisp-like configuration syntax for those that want it, it can simply take strings too. IMO there's no point in making it consistent since the original syntax isn't consistent in the first place, you can check out some examples here . > >> +(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= that undoes that > changes? In which case it wouldn=E2=80=99t be one-shot anymore. > I found here that xmodmap settings can be simply reversed by calling setxkbmap, so I've added a stop procedure for this. >> +(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. > Done. --=20 Best regards, conses