From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?B?5a6L5paH5q2m?= Subject: Re: [PATCH] services: Add console-keymap service. Date: Sun, 26 Apr 2015 07:53:36 +0800 Message-ID: <87y4lfwyrj.fsf@gmail.com> References: <87vbgkj6qt.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym9sj-0004AP-C0 for guix-devel@gnu.org; Sat, 25 Apr 2015 19:53:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ym9sf-0005bw-BV for guix-devel@gnu.org; Sat, 25 Apr 2015 19:53:09 -0400 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]:35280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym9sf-0005bh-4g for guix-devel@gnu.org; Sat, 25 Apr 2015 19:53:05 -0400 Received: by pabtp1 with SMTP id tp1so86892100pab.2 for ; Sat, 25 Apr 2015 16:53:04 -0700 (PDT) In-Reply-To: <87vbgkj6qt.fsf@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Alex Kost , guix-devel@gnu.org Alex Kost writes: > Sometimes people on #guix ask about a way to change a console keymap, > for example: . > > So I think it would be good to add a service for loadkeys, what do > people think? > > =E5=AE=8B=E6=96=87=E6=AD=A6: This patch is based on your work > , so > I tried to credit you in a commit message, but I'm not sure If I did it > right. Is it OK? Yes, thanks! > > From f879481f96386617d070b146aa2c3d1988deff40 Mon Sep 17 00:00:00 2001 > From: Alex Kost > Date: Sat, 25 Apr 2015 22:52:29 +0300 > Subject: [PATCH] services: Add console-keymap service. > MIME-Version: 1.0 > Content-Type: text/plain; charset=3DUTF-8 > Content-Transfer-Encoding: 8bit > > * gnu/services/base.scm (console-keymap-service): New procedure. > * doc/guix.texi (Base Services): Document it. > > Co-authored-by: =E5=AE=8B=E6=96=87=E6=AD=A6 > --- > doc/guix.texi | 5 +++++ > gnu/services/base.scm | 15 +++++++++++++++ > 2 files changed, 20 insertions(+) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 4269d4f..c342ebc 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -4737,6 +4737,11 @@ passed to @command{guix-daemon}. > Run @var{udev}, which populates the @file{/dev} directory dynamically. > @end deffn >=20=20 > +@deffn {Monadic Procedure} console-keymap-service @var{file} > +Return a service to load console keymap from @var{file} using > +@command{loadkeys} command. > +@end deffn > + >=20=20 > @node Networking Services > @subsubsection Networking Services > diff --git a/gnu/services/base.scm b/gnu/services/base.scm > index d0a2e8c..49eccda 100644 > --- a/gnu/services/base.scm > +++ b/gnu/services/base.scm > @@ -1,5 +1,6 @@ > ;;; GNU Guix --- Functional package management for GNU > ;;; Copyright =C2=A9 2013, 2014, 2015 Ludovic Court=C3=A8s > +;;; Copyright =C2=A9 2015 Alex Kost > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -46,6 +47,7 @@ > swap-service > user-processes-service > host-name-service > + console-keymap-service > console-font-service > udev-service > mingetty-service > @@ -313,6 +315,19 @@ stopped before 'kill' is called." > (else > (zero? (cdr (waitpid pid)))))))) >=20=20 > +(define (console-keymap-service file) > + "Return a service to load console keymap from @var{file}." > + (with-monad %store-monad > + (return > + (service > + (documentation > + (string-append "Load '" file "' console keymap (loadkeys).")) > + (provision '(console-keymap)) > + (start #~(lambda _ > + (zero? (system* (string-append #$kbd "/bin/loadkeys") > + #$file)))) > + (respawn? #f))))) > + > (define* (console-font-service tty #:optional (font "LatGrkCyr-8x16")) > "Return a service that sets up Unicode support in @var{tty} and loads > @var{font} for that tty (fonts are per virtual console in Linux.)" > --=20 > 2.2.1