From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YPVrGx6w0GBYSgEAgWs5BA (envelope-from ) for ; Mon, 21 Jun 2021 17:28:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 4FYWFx6w0GCGVQAAbx9fmQ (envelope-from ) for ; Mon, 21 Jun 2021 15:28:30 +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 139B8274B3 for ; Mon, 21 Jun 2021 17:28:30 +0200 (CEST) Received: from localhost ([::1]:47640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvLqf-0008D9-0R for larch@yhetil.org; Mon, 21 Jun 2021 11:28:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvLqK-0007uN-OK for guix-patches@gnu.org; Mon, 21 Jun 2021 11:28:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53510) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lvLqD-0004Dl-Mt for guix-patches@gnu.org; Mon, 21 Jun 2021 11:28:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lvLqD-0001KU-J6 for guix-patches@gnu.org; Mon, 21 Jun 2021 11:28:01 -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, 21 Jun 2021 15:28:01 +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: Mathieu Othacehe Cc: 47994@debbugs.gnu.org, luhui , Maxime Devos Received: via spool by 47994-submit@debbugs.gnu.org id=B47994.16242892615077 (code B ref 47994); Mon, 21 Jun 2021 15:28:01 +0000 Received: (at 47994) by debbugs.gnu.org; 21 Jun 2021 15:27:41 +0000 Received: from localhost ([127.0.0.1]:36823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvLps-0001Jp-HX for submit@debbugs.gnu.org; Mon, 21 Jun 2021 11:27:40 -0400 Received: from m12-16.163.com ([220.181.12.16]:57369) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvLpo-0001JX-W9 for 47994@debbugs.gnu.org; Mon, 21 Jun 2021 11:27:39 -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=yOnAk 7FC55yveEMjSLJ1fN29tFm83GxerKz9sFQY67Q=; b=i0i7WhRfgiFvd1EsYzIym GzXPO9aAD/CYQawia9z6mt8TrbAeU2o1vts6WqqHwo/dhUv4IVtt3/2tv6HUL7cw Lw+IE/ktysTxubtoU1K1Qg/QdQ/fsHG7mAAoT+pyRqLuFJPS6d4P0mJiJ0nLmmja 0504yr7mVfzamGgfSsJaaY= Received: from localhost (unknown [223.104.197.242]) by smtp12 (Coremail) with SMTP id EMCowAC3w4zfr9BggRcVyg--.54044S3; Mon, 21 Jun 2021 23:27:28 +0800 (CST) Date: Mon, 21 Jun 2021 23:28:34 +0800 From: luhui Message-ID: References: <328fbd240891f63e52020fa59341c8fbf1f3bb42.camel@telenet.be> <87bl8lerbe.fsf_-_@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="lfrZAGjQXGvRdgbB" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87bl8lerbe.fsf_-_@gnu.org> X-CM-TRANSID: EMCowAC3w4zfr9BggRcVyg--.54044S3 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjTRoa0yUUUUU X-Originating-IP: [223.104.197.242] X-CM-SenderInfo: 5oxk3xlqv6il2tof0z/1tbiDwC4DFUMYiA1XwAAsK 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=1624289310; 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=yOnAk7FC55yveEMjSLJ1fN29tFm83GxerKz9sFQY67Q=; b=SqE7tgpQU41whTAlIok02mzJcMxYlx0w7W8TXCV9AEsAbDqT7W8eKiIUU2n03pL7kEmhim 626VHDWcSve7owIbnbA8MY+VgRtvtUN12FQIb7BipOkCUn8QSvOXD7BWWcRYkowbNX0AdT Vpw8Tku4A7fihNxOy4+y7OzBo9zhH9FrYud3RcMeNON6xdSqEC7aU14JC73sVOytNw/C/j s5tTDWIusqc0tA++eKMiv/2z4hEUvEKkuhkd9xN74U4lsXdCemQTJtG5pdjJXwmmilFiT0 Anxx8Y/MhthkWqLsclAr/R4YF3jZxshZCJIaes/byt7FyyHN3m8AirYd6g2wfg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624289310; a=rsa-sha256; cv=none; b=daqUKmnQYWCf+oV7J41kwh1QjqOPauxqbHWVTCNaLPFuqxZ+Hj/HguLI/V7ZJ1epVkJJSx YTXHFo4M91juEA8Njm+mdgSXKY4ePzZ/X+5a0hzti/JWXJSN/Ao1e6n5uhtWYAPToYtIIj fgCk4ief0xeZ0leKEBqRKkx83ctDDzux57DNa3H6RKhDASrKBg77oM6VkB2xDXF/LuKuh3 gjMXDRG5Vz9zad43DPoGmFz9H1LIj7nmP+IfDvSIY8dsjgtlMoFg07qyuad6/GH5PCvZtt 1EDuAq6SUFUNRxIrriMYEC8xqC8k2dMsDENyr+NU7lWAyuRqqRDYQqbtMwxYSg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=163.com header.s=s110527 header.b=i0i7WhRf; 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.18 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=163.com header.s=s110527 header.b=i0i7WhRf; 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: 139B8274B3 X-Spam-Score: 0.18 X-Migadu-Scanner: scn1.migadu.com X-TUID: yOdpxvwLZyHo --lfrZAGjQXGvRdgbB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jun 04, 2021 at 02:40:21PM +0200, Mathieu Othacehe wrote: > > Hello, > > > + ,@(if variant `("--xkb-layout" ,variant) '()) > > This is supposed to be "--xkb-variant" here, right? Sorry, made this mistake, now I fixed it and sent a new patch. > > Otherwise, it looks good to me. > > Thanks, > > Mathieu --lfrZAGjQXGvRdgbB 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 310ff049da9e6ea7f0556430b0b51580a675d696 Mon Sep 17 00:00:00 2001 From: luhui Date: Mon, 21 Jun 2021 22:58:06 +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 66c6adc4f5..eb151a56fb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -91,6 +91,7 @@ Copyright @copyright{} 2020 Edgar Vincent@* Copyright @copyright{} 2021 Maxime Devos@* Copyright @copyright{} 2021 B. Wilson@* Copyright @copyright{} 2021 Xinglu Chen@* +Copyright @copyright{} 2021 Hui Lu@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -15280,6 +15281,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 3be2e984c3..6922d7f90b 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 Hui Lu ;;; ;;; 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)) @@ -2267,7 +2269,9 @@ notably to select, copy, and paste text. The default options use the (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 @@ -2280,7 +2284,8 @@ notably to select, copy, and paste text. The default options use the (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 @@ -2289,6 +2294,18 @@ notably to select, copy, and paste text. The default options use the "--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-variant" ,variant) '()) + ,@(if model `("--xkb-model" ,model) '()) + ,@(if (null? options) + '() + `("--xkb-options" ,(string-join options ","))))) + '()) #$@(if hardware-acceleration? '("--hwaccel") '()) "--login" "--" #$login-program #$@login-arguments -- 2.32.0 --lfrZAGjQXGvRdgbB--