;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Mathieu Othacehe ;;; Copyright © 2020 Florian Pelz ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu installer keymap) #:use-module (guix records) #:use-module (sxml match) #:use-module (sxml simple) #:use-module (ice-9 binary-ports) #:use-module (ice-9 ftw) #:use-module (ice-9 match) #:use-module (ice-9 regex) #:export (
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/boost.scm')
0 files changed, 0 insertions, 0 deletions
(x11-keymap-layout (name name) (synopsis (car (assoc-ref rest-layout 'shortDescription))) (description (car (assoc-ref rest-layout 'description))) (variants '()))])) (let ((sxml (call-with-input-file file (lambda (port) (xml->sxml port #:trim-whitespace? #t))))) (match (sxml-match sxml [(*TOP* ,pi (xkbConfigRegistry (@ . ,ignored) (modelList ,[model -> m] ...) (layoutList ,[layout -> l] ...) . ,rest)) (list (list m ...) (list l ...))]) ((models layouts) (values models layouts))))) (define (kmscon-update-keymap model layout variant options) "Update kmscon keymap with the provided MODEL, LAYOUT, VARIANT and OPTIONS." (and=> (getenv "KEYMAP_UPDATE") (lambda (keymap-file) (unless (file-exists? keymap-file) (error "Unable to locate keymap update file")) ;; See file gnu/packages/patches/kmscon-runtime-keymap-switch.patch. ;; This dirty hack makes possible to update kmscon keymap at runtime by ;; writing an X11 keyboard model, layout and variant to a named pipe ;; referred by KEYMAP_UPDATE environment variable. (call-with-output-file keymap-file (lambda (port) (format port model) (put-u8 port 0) (format port layout) (put-u8 port 0) (format port (or variant "")) (put-u8 port 0) (format port (or options "")) (put-u8 port 0))))))