aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorconses <contact@conses.eu>2023-03-17 13:06:35 +0100
committerLudovic Courtès <ludo@gnu.org>2023-03-17 23:20:36 +0100
commit511ae8325db0dfc7803d7b98d7e4d8f76774e8c5 (patch)
tree8117117a76be2f884d86606a23bb82520a65a3b5 /doc
parent97a759769d9dc93a5f5745d2aa4ae324a4ef1b3d (diff)
downloadguix-511ae8325db0dfc7803d7b98d7e4d8f76774e8c5.tar
guix-511ae8325db0dfc7803d7b98d7e4d8f76774e8c5.tar.gz
home: services: Add home-xmodmap-service-type.
* gnu/home/services/desktop.scm (home-xmodmap-service-type) (home-xmodmap-configuration): New variables; (serialize-xmodmap-configuration) (xmodmap-shepherd-service): New procedures; * doc/guix.texi (Desktop Services): Document it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/guix.texi41
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 0a965f53c0..edf410d024 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -42626,6 +42626,47 @@ A timeout in seconds after which to hide cursor.
@end deftp
+@defvar home-xmodmap-service-type
+This is the service type for the
+@uref{https://gitlab.freedesktop.org/xorg/app/xmodmap,xmodmap} utility
+to modify keymaps and pointer button mappings under the Xorg display
+server. Its associated value must be a
+@code{home-xmodmap-configuration} record, as shown below.
+
+The @code{key-map} field takes a list of objects, each of which is
+either a @dfn{statement} (a string) or an @dfn{assignment} (a pair of
+strings). As an example, the snippet below swaps around the
+@kbd{Caps_Lock} and the @kbd{Control_L} keys, by first removing the
+keysyms (on the right-hand side) from the corresponding modifier maps
+(on the left-hand side), re-assigning them by swapping each other out,
+and finally adding back the keysyms to the modifier maps.
+
+@lisp
+(service home-xmodmap-service-type
+ (home-xmodmap-configuration
+ (key-map '(("remove Lock" . "Caps_Lock")
+ ("remove Control" . "Control_L")
+ ("keysym Control_L" . "Caps_Lock")
+ ("keysym Caps_Lock" . "Control_L")
+ ("add Lock" . "Caps_Lock")
+ ("add Control" . "Control_L")))))
+@end lisp
+@end defvar
+
+@deftp {Data Type} home-xmodmap-configuration
+The configuration record for @code{home-xmodmap-service-type}. Its
+available fields are:
+
+@table @asis
+@item @code{xmodmap} (default: @code{xmodmap}) (type: file-like)
+The @code{xmodmap} package to use.
+
+@item @code{key-map} (default: @code{'()}) (type: list)
+The list of expressions to be read by @code{xmodmap} on service startup.
+
+@end table
+@end deftp
+
@node Guix Home Services
@subsection Guix Home Services