From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wEqCGJUghmBoFQAAgWs5BA (envelope-from ) for ; Mon, 26 Apr 2021 04:08:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id aAsjFJUghmCVOQAAB5/wlQ (envelope-from ) for ; Mon, 26 Apr 2021 02:08:21 +0000 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 AFCC229B98 for ; Mon, 26 Apr 2021 04:08:20 +0200 (CEST) Received: from localhost ([::1]:45088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1laqfb-00030b-Rp for larch@yhetil.org; Sun, 25 Apr 2021 22:08:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laqfN-00030V-R0 for guix-patches@gnu.org; Sun, 25 Apr 2021 22:08:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1laqfK-00032Z-NV for guix-patches@gnu.org; Sun, 25 Apr 2021 22:08:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1laqfK-0008Qn-G7 for guix-patches@gnu.org; Sun, 25 Apr 2021 22:08:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47994] [PATCH] services: kmscon: Add xkb-layout and xkb-options fields. Resent-From: luhui Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 26 Apr 2021 02:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47994 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 47994@debbugs.gnu.org, luhui Received: via spool by 47994-submit@debbugs.gnu.org id=B47994.161940284832369 (code B ref 47994); Mon, 26 Apr 2021 02:08:02 +0000 Received: (at 47994) by debbugs.gnu.org; 26 Apr 2021 02:07:28 +0000 Received: from localhost ([127.0.0.1]:44091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1laqel-0008Q0-R8 for submit@debbugs.gnu.org; Sun, 25 Apr 2021 22:07:28 -0400 Received: from m12-15.163.com ([220.181.12.15]:47152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1laqei-0008Pl-F7 for 47994@debbugs.gnu.org; Sun, 25 Apr 2021 22:07:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:Message-ID:MIME-Version; bh=hJJu7 6yEI6ipy4g6hWzaVfhJAHaTuPzb7CjZFZTvEaM=; b=B93hmf9Dkw0EXyT3v4DUq CA1WIsOTZTQz9CB6WE7t9Z2Wb1dN4yeftikys8p/HJG+XsQA0VUR9kwEbBTl4sCv 5LjrEpF/+Z39rcN8kU7P1LWg535gBNVSFUt8ACercUEsB74UQyujtKHXKgCCtRE0 Tfgs4ei9lc0oOik0vUwrbE= Received: from localhost (unknown [110.178.47.120]) by smtp11 (Coremail) with SMTP id D8CowAC3399IIIZg9n1IAw--.22992S3; Mon, 26 Apr 2021 10:07:18 +0800 (CST) Date: Mon, 26 Apr 2021 10:07:03 +0800 From: luhui Message-ID: References: <328fbd240891f63e52020fa59341c8fbf1f3bb42.camel@telenet.be> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="NUNBHy/ESFyMFLW9" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CM-TRANSID: D8CowAC3399IIIZg9n1IAw--.22992S3 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxUbjjgDUUUU X-Originating-IP: [110.178.47.120] X-CM-SenderInfo: 5oxk3xlqv6il2tof0z/1tbiMhaADFWBtyH2TwAAsT 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: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619402901; 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=hJJu76yEI6ipy4g6hWzaVfhJAHaTuPzb7CjZFZTvEaM=; b=ph5q6ZL05NI4gSY0j+IBqJf+9gti6gLrVMCvG0O8Y0KyRa17R2RLWlqqeOyabg/83Wu9Ru 24Ta58IuT0x97Ywg0yfvNkKpsmgjEt6dI4eff8EHXjGqW7W2qMGnjGlg7+qNBo1wmhEjOt pqb1UnYDNJtrfZXMxBLspjxKfe57KIoiMzLn7Ez+RXnSWocJlLvyVwR6Lpxpa5p3LMVV1B 757UpLXX7Tx93OGRDAP7pzjloIkHtT+0ooyCwn8gDPggiSIl7yppCHF/01dfdx6ZjeONwa o488eMBcpblK5vq5wYEXuT43FzCD5mjGRyByYn8iPwOXqluhehz2jfpkLjZakQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619402901; a=rsa-sha256; cv=none; b=BjjM/eQ3S1etAvJTXf5KuVFfOeLR5BSQxbjcZwkfd149V3+lficFH90Ubu5VatRZx7av8n x6iyo0BEiSBjqIZ7wp3a91j3OU/PMGQGCXUneKUDxvOrJbZsLMbsGGORk6zHCngi/Ij/Tp ptvlYHg6wQEvPKMJre5bSiDOBJkC6XmMMD5usiNJXlTUCrBVrXsOdExt74mJwPJoVd5z0T 9LyiO9ImeygSHO0SsWixmDkuPzNVvge+4Y+tL9GryFIzv4eyQJvYYwwF7JytSOsy4FVK+c EA3ZZEGxLRsfs53skJJX727wPlCkNgp3nahP+WxmO+YGfqGXqab7dr2ivjfwjw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=163.com header.s=s110527 header.b=B93hmf9D; dmarc=fail reason="SPF not aligned (relaxed)" header.from=163.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 0.15 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=163.com header.s=s110527 header.b=B93hmf9D; dmarc=fail reason="SPF not aligned (relaxed)" header.from=163.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: AFCC229B98 X-Spam-Score: 0.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: Zf+C6R+4ruWP --NUNBHy/ESFyMFLW9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline OK,Re-written the code according to your suggestion. new patch: --NUNBHy/ESFyMFLW9 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="0001-services-kmscon-Add-keyboard-layout-fields.patch" Content-Transfer-Encoding: 8bit >From 49450d3f87bebb0eeb5a2d4a161151b33d413c15 Mon Sep 17 00:00:00 2001 From: luhui Date: Sat, 24 Apr 2021 10:56:03 +0800 Subject: [PATCH] services: kmscon: Add keyboard-layout fields. * gnu/services/base.scm (): Add keyboard-layout fields. * doc/guix.texi (Base Services): Document it. --- doc/guix.texi | 9 +++++++++ gnu/services/base.scm | 21 +++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index b9019d5550..74e9ceaf5e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -88,6 +88,7 @@ Copyright @copyright{} 2020 John Soo@* Copyright @copyright{} 2020 Jonathan Brielmaier@* Copyright @copyright{} 2020 Edgar Vincent@* Copyright @copyright{} 2021 Maxime Devos@* +Copyright @copyright{} 2021 lu hui@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -15254,6 +15255,14 @@ Font engine used in Kmscon. @item @code{font-size} (default: @code{12}) Font size used in Kmscon. +@item @code{keyboard-layout} (default: @code{#f}) +If this is @code{#f}, Kmscon uses the default keyboard layout---usually US +English (``qwerty'') for a 105-key PC keyboard. + +Otherwise this must be a @code{keyboard-layout} object specifying the keyboard +layout. @xref{Keyboard Layout}, for more information on how to specify the +keyboard layout. + @item @code{kmscon} (default: @var{kmscon}) The Kmscon package to use. diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 24b3ea785b..0878746fa8 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2020 Florian Pelz ;;; Copyright © 2020 Brice Waegeneire ;;; Copyright © 2021 qblade +;;; Copyright © 2021 luhui ;;; ;;; This file is part of GNU Guix. ;;; @@ -41,6 +42,7 @@ #:use-module (gnu system shadow) ; 'user-account', etc. #:use-module (gnu system uuid) #:use-module (gnu system file-systems) ; 'file-system', etc. + #:use-module (gnu system keyboard) #:use-module (gnu system mapped-devices) #:use-module ((gnu system linux-initrd) #:select (file-system-packages)) @@ -2313,7 +2315,9 @@ This service is not part of @var{%base-services}." (font-engine kmscon-configuration-font-engine (default "pango")) (font-size kmscon-configuration-font-size - (default 12))) + (default 12)) + (keyboard-layout kmscon-configuration-keyboard-layout + (default #f))) ; #f | (define kmscon-service-type (shepherd-service-type @@ -2326,7 +2330,8 @@ This service is not part of @var{%base-services}." (auto-login (kmscon-configuration-auto-login config)) (hardware-acceleration? (kmscon-configuration-hardware-acceleration? config)) (font-engine (kmscon-configuration-font-engine config)) - (font-size (kmscon-configuration-font-size config))) + (font-size (kmscon-configuration-font-size config)) + (keyboard-layout (kmscon-configuration-keyboard-layout config))) (define kmscon-command #~(list @@ -2335,6 +2340,18 @@ This service is not part of @var{%base-services}." "--no-switchvt" ;Prevent a switch to the virtual terminal. "--font-engine" #$font-engine "--font-size" #$(number->string font-size) + #$@(if keyboard-layout + (let* ((layout (keyboard-layout-name keyboard-layout)) + (variant (keyboard-layout-variant keyboard-layout)) + (model (keyboard-layout-model keyboard-layout)) + (options (keyboard-layout-options keyboard-layout))) + `("--xkb-layout" ,layout + ,@(if variant `("--xkb-layout" ,variant) '()) + ,@(if model `("--xkb-model" ,model) '()) + ,@(if (null? options) + '() + `("--xkb-options" ,(string-join options ","))))) + '()) #$@(if hardware-acceleration? '("--hwaccel") '()) "--login" "--" #$login-program #$@login-arguments -- 2.31.1 --NUNBHy/ESFyMFLW9--