GNU bug report logs - #66932
[PATCH] services: Add xremap service.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: VÖRÖSKŐI András <voroskoi@HIDDEN>; Keywords: patch; dated Sat, 4 Nov 2023 15:20:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 66932 <at> debbugs.gnu.org:


Received: (at 66932) by debbugs.gnu.org; 2 Dec 2023 10:48:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 02 05:48:48 2023
Received: from localhost ([127.0.0.1]:56728 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r9NYG-0005wl-CN
	for submit <at> debbugs.gnu.org; Sat, 02 Dec 2023 05:48:48 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:38690)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1r9NYE-0005wX-Vd
 for 66932 <at> debbugs.gnu.org; Sat, 02 Dec 2023 05:48:47 -0500
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 <ludo@HIDDEN>)
 id 1r9NY0-0004Bs-D8; Sat, 02 Dec 2023 05:48:32 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=YhNJMvY44LwCOvi2mhDbN0g79PqfPbtzclcEid79+mQ=; b=KoEQ3MGxRE8BTLvMZA85
 4N4L2Lyk8GxNjprLvdoPSCewBx8dQIfSgSkFUoM7hp3oTls46Kt/i2mMFFkoptjiL2yKNz0Q1pRQi
 xVA2qE2MENSIJIwYhDKBipR4wUJ79QsGf0eUCKUJ6lnn9dbXsHYVwJCuASdqstB5mNzbQx0nvmmJd
 TnUVWW9pIf1uuIDm67n229o85tHNLuWtokiic9P8YVoCV2Vf6MVd9YLMtcmj1jN6OSZaadC3Qxu57
 Rue3OUHG7kp8oz8zqm2bWv0iSJ/+bPL3OyUC7up8W/4Ure7RKXBVYayjmLmd1kZ5K1oN2FGPJxzpz
 GDnXVsvliMw67g==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: =?utf-8?B?VsOWUsOWU0vFkEkgQW5kcsOhcw==?= <voroskoi@HIDDEN>
Subject: Re: [bug#66932] [PATCH] services: Add xremap service.
In-Reply-To: <57d94dcb19152592014053ef0bc81e95e4f6b602.1699111054.git.voroskoi@HIDDEN>
 (=?utf-8?B?IlbDllLDllNLxZBJIEFuZHLDoXMiJ3M=?= message of "Sat, 4 Nov 2023
 16:17:35 +0100")
References: <57d94dcb19152592014053ef0bc81e95e4f6b602.1699111054.git.voroskoi@HIDDEN>
Date: Sat, 02 Dec 2023 11:48:30 +0100
Message-ID: <87o7f8hoch.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66932
Cc: 66932 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Andr=C3=A1s,

V=C3=96R=C3=96SK=C5=90I Andr=C3=A1s <voroskoi@HIDDEN> skribis:

> * gnu/services/desktop.scm (<xremap-configuration>): New record.
> (xremap-shepherd-service): New procedure.
> (xremap-service-type): New variable.
> * doc/guix.texi (Desktop Services): Document this.
>
> Change-Id: I76f9e238c72fb47226140e2b86dd9490cd9c9351

Nice!

> +(append
> +  (list
> +   (service xremap-service-type
> +                    (xremap-configuration
> +                     (config-file (plain-file "xremap.yml"
> +"modmap:
> +  - name: Global
> +    remap:
> +      CAPSLOCK:
> +        held: CONTROL_L
> +        alone: Esc
> +        alone_timeout_millis: 1000"))))

Did you consider writing =E2=80=9Cbindings=E2=80=9D so that one can configu=
re it Scheme,
as is the case for most other services?  (To be clear, I think we should
still allow people to provide their own Yaml file as is done here.)

If that=E2=80=99s too tricky/impractical, we can keep the patch as is, but
adding =E2=80=9Cnative=E2=80=9D configuration on top of that would be sweet.

I wonder if it would make sense, in a future patch, to also provide
=E2=80=98home-xremap-service-type=E2=80=99 as a direct mapping of this serv=
ice.  Food
for thought.

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#66932; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Nov 2023 15:19:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 04 11:19:04 2023
Received: from localhost ([127.0.0.1]:35591 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qzIQR-0005ky-LY
	for submit <at> debbugs.gnu.org; Sat, 04 Nov 2023 11:19:04 -0400
Received: from lists.gnu.org ([2001:470:142::17]:37850)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <voroskoi@HIDDEN>) id 1qzIQO-0005kT-S4
 for submit <at> debbugs.gnu.org; Sat, 04 Nov 2023 11:19: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 <voroskoi@HIDDEN>)
 id 1qzIPi-0003lf-Uj
 for guix-patches@HIDDEN; Sat, 04 Nov 2023 11:18:18 -0400
Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <voroskoi@HIDDEN>)
 id 1qzIPg-0001Bp-Ue
 for guix-patches@HIDDEN; Sat, 04 Nov 2023 11:18:18 -0400
Received: by mail-lj1-x232.google.com with SMTP id
 38308e7fff4ca-2c5028e5b88so42774581fa.3
 for <guix-patches@HIDDEN>; Sat, 04 Nov 2023 08:18:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1699111095; x=1699715895; darn=gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=STFoWm0JOnNe5L/uTnUaIJ9JXXkgxDjqHIJJQTf+WG0=;
 b=ekfgSsWXuyQLAzmBGilnrZ12tIHXlWd5uOY0dbeeUJ4MtIBZZFitys8dnaew0rxhZk
 ubG0uv+OW8Nus5M+Ev0psrHKsulWIZADC21TTillm+Kh8itT/l3jsJoBcUhdUlKNPOrB
 Q7qmtKyPiYJg1Vt0AqrOwGo+L/QJsQMdXS+lWCjlFY9QvAXpKXJS22pT2Oq/3NaSsAli
 ARGlh/aJVDuNtgysMtGGDTzTwvs+LjWMBer4qFtA6H7WpHnZWhccQi+GtT3jNEdI2+5T
 HatjvVEQDtc2fyFcjkf/LJZD02tmRZRTfxU49aipHmEgXEQ6DftHNfb0ngWOq/LAmJ3Z
 0+Nw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1699111095; x=1699715895;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=STFoWm0JOnNe5L/uTnUaIJ9JXXkgxDjqHIJJQTf+WG0=;
 b=rEMG1XXPudORTwL9H2geCveB+49gWv/ABAz4KuCwhfBbaeqnBx3YbBx+E373n3kJWm
 EKBDAyqy75+b/AruUbTZIl3gIij+try9r91WBWbYcRe9qiGGVkfRERkX7iiqAfjVZbVD
 47Dbq4XF2iZLXI6rOcoMvy/hYJm2462PJLD8W/FGk0vFQ7KOmqmwjTBpEIoNULuOuHYi
 +UslW8yJIMwDxiuK7plpD4NXeIMGIs+co+Zc9hpmh3DLHRJHHjVMml5kjpLk3RF56uxw
 16HvbUfCi5STaKbeXGkwsm9QeXCQcLqkYcpkw7uZFR0SfjppuorZ8r9/gyP8vsUTSxLw
 fdtg==
X-Gm-Message-State: AOJu0YxI4fbT5rw0hzrZxiJoK4zKPywx734teqr+VLre4pR+DYDPIizh
 Y9Y8amvYYHsgGkUH3C2FZaCnCS8WFDA=
X-Google-Smtp-Source: AGHT+IEoZxP1nn3fTwKe2OP7FRoGUNvFds4xbz9D/IqaFKGDuAb18iGmQXuCkWqozw64NKkigp6/6A==
X-Received: by 2002:a2e:9410:0:b0:2c4:fe14:a85 with SMTP id
 i16-20020a2e9410000000b002c4fe140a85mr21527420ljh.18.1699111094309; 
 Sat, 04 Nov 2023 08:18:14 -0700 (PDT)
Received: from localhost (87-97-126-39.pool.digikabel.hu. [87.97.126.39])
 by smtp.gmail.com with ESMTPSA id
 10-20020a05600c230a00b004068495910csm6117100wmo.23.2023.11.04.08.18.13
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 04 Nov 2023 08:18:13 -0700 (PDT)
From: =?UTF-8?q?V=C3=96R=C3=96SK=C5=90I=20Andr=C3=A1s?= <voroskoi@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] services: Add xremap service.
Date: Sat,  4 Nov 2023 16:17:35 +0100
Message-ID: <57d94dcb19152592014053ef0bc81e95e4f6b602.1699111054.git.voroskoi@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2a00:1450:4864:20::232;
 envelope-from=voroskoi@HIDDEN; helo=mail-lj1-x232.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: =?UTF-8?q?V=C3=96R=C3=96SK=C5=90I=20Andr=C3=A1s?= <voroskoi@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

* gnu/services/desktop.scm (<xremap-configuration>): New record.
(xremap-shepherd-service): New procedure.
(xremap-service-type): New variable.
* doc/guix.texi (Desktop Services): Document this.

Change-Id: I76f9e238c72fb47226140e2b86dd9490cd9c9351
---
 doc/guix.texi            | 37 ++++++++++++++++++++++++++++++++++++
 gnu/services/desktop.scm | 41 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index b90078be06..e61b4e2650 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -119,6 +119,7 @@
 Copyright @copyright{} 2023 Zheng Junjie@*
 Copyright @copyright{} 2023 Brian Cully@*
 Copyright @copyright{} 2023 Felix Lechner@*
+Copyright @copyright{} 2023 VÖRÖSKŐI András@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -25011,6 +25012,42 @@ Desktop Services
 @end table
 @end deftp
 
+@defvar xremap-service-type
+@uref{https://github.com/k0kubun/xremap/, xremap} xremap is a key remapper for
+Linux. Unlike xmodmap, it supports app-specific remapping and Wayland.
+
+@lisp
+(append
+  (list
+   (service xremap-service-type
+                    (xremap-configuration
+                     (config-file (plain-file "xremap.yml"
+"modmap:
+  - name: Global
+    remap:
+      CAPSLOCK:
+        held: CONTROL_L
+        alone: Esc
+        alone_timeout_millis: 1000"))))
+
+  ;; normally one would want %base-services
+  %base-services)
+
+@end lisp
+@end defvar
+
+@deftp {Data Type} xremap-configuration
+Configuration record for the xremap daemon service.
+
+@table @asis
+@item @code{package} (default: @code{rust-xremap})
+The xremap package to use.
+
+@item @code{config-file} (default: @samp{(plain-file "xremap.yml" "")})
+Config file to use with xremap.
+
+@end table
+@end deftp
 
 @node Sound Services
 @subsection Sound Services
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 5b79fbcda1..1cfa7c2169 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -17,6 +17,7 @@
 ;;; Copyright © 2021, 2022 muradm <mail@HIDDEN>
 ;;; Copyright © 2023 Bruno Victal <mirai@HIDDEN>
 ;;; Copyright © 2023 Zheng Junjie <873216071@HIDDEN>
+;;; Copyright © 2023 VÖRÖSKŐI András <voroskoi@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -72,6 +73,7 @@ (define-module (gnu services desktop)
   #:use-module (gnu packages mate)
   #:use-module (gnu packages nfs)
   #:use-module (gnu packages enlightenment)
+  #:use-module (gnu packages rust-apps)
   #:use-module (guix deprecation)
   #:use-module (guix records)
   #:use-module (guix packages)
@@ -184,6 +186,9 @@ (define-module (gnu services desktop)
             seatd-configuration
             seatd-service-type
 
+	    xremap-configuration
+	    xremap-service-type
+
             %desktop-services))
 
 ;;; Commentary:
@@ -1863,6 +1868,42 @@ (define seatd-service-type
      (service-extension shepherd-root-service-type seatd-shepherd-service)))
    (default-value (seatd-configuration))))
 
+;;;
+;;; xremap
+;;;
+
+(define-record-type* <xremap-configuration>
+  xremap-configuration make-xremap-configuration
+  xremap-configuration?
+  (package xremap-configuration-package
+           (default rust-xremap))
+  (config-file xremap-configuration-config-file
+           (default (plain-file "xremap.yml" ""))))
+
+(define (xremap-shepherd-service config)
+  "Return an <sheperd-service> for xremap with CONFIG"
+  (match-record config <xremap-configuration>
+                (package config-file)
+                (list
+                (shepherd-service
+                 (provision '(xremap))
+                 (documentation "xremap daemon")
+                 (requirement '())
+                 (start #~(make-forkexec-constructor
+                           (list #$(file-append package "/bin/xremap")
+                                 #$config-file)))
+                 (stop #~(make-kill-destructor))))))
+
+(define xremap-service-type
+  (service-type
+   (name 'xremap)
+   (extensions
+    (list
+     (service-extension shepherd-root-service-type
+                        xremap-shepherd-service)))
+   (default-value (xremap-configuration))
+   (description "Run the @code{xremap} utility to modify keymaps system wide.")))
+
 
 ;;;
 ;;; The default set of desktop services.

base-commit: 9dcd8802f5bc472579f23a38dcf437f8a9ac976c
-- 
2.41.0





Acknowledgement sent to VÖRÖSKŐI András <voroskoi@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#66932; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 2 Dec 2023 11:00:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.