;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019, 2020 Ludovic Courtès ;;; ;;; 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 system keyboard) #:use-module (guix gexp) #:use-module ((gnu packages xorg) #:select (xkeyboard-config console-setup)) #:use-module (srfi srfi-9 gnu) #:use-module (ice-9 ma
aboutsummaryrefslogtreecommitdiff
(ice-9 match)) (define pipe (open-pipe* OPEN_READ #+(file-append console-setup "/bin/ckbcomp") (string-append "-I" #+(file-append xkeyboard-config "/share/X11/xkb")) "-rules" "base" #$@(match (keyboard-layout-model layout) (#f '()) (model `("-model" ,model))) #$(keyboard-layout-name layout) #$(or (keyboard-layout-variant layout) "") #$(string-join (keyboard-layout-options layout) ","))) (call-with-output-file #$output (lambda (output) (dump-port pipe output))) ;; Note: ckbcomp errors out when the layout name is unknown, but ;; merely emits a warning when the variant is unknown. (unless (zero? (close-pipe pipe)) (error "failed to create console keymap for keyboard layout" #$(keyboard-layout-name layout)))))) (computed-file (string-append "console-keymap." (string-map (match-lambda (#\, #\-) (chr chr)) (keyboard-layout-name layout))) build))
AgeCommit message (Expand)Author