diff mbox series

[bug#64399,v2] installer: Restore LatGrkCyr-8x16 console font depending on language.

Message ID 48d9788a3a2dceab15c5432bd439d8f33492d4a5.1688233529.git.vegan@libre.net.ua
State New
Headers show
Series [bug#64399,v2] installer: Restore LatGrkCyr-8x16 console font depending on language. | expand

Commit Message

Denys Nykula July 1, 2023, 8:48 p.m. UTC
Partially-Fixes: <https://issues.guix.gnu.org/64006>

* gnu/installer/services.scm (system-services->configuration): When the
LANGUAGE environment variable matches a known native console font, wrap the
base services with modify-services, configuring console-font-service-type to
set the native console font on every tty instead of the default console font.
---
Untabified version 2 with suggested naming changes.  Version 1 was in fact
written in Emacs and formatted using the tab key, but I was editing remotely
and hadn't customized enable-remote-dir-locals, so .dir-locals.el
wasn't applied.

 gnu/installer/services.scm | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)


base-commit: b24a05830d11e3011eee4bc5f60a41e26188cde1

Comments

pelzflorian July 5, 2023, 7:55 p.m. UTC | #1
Pryvit Denys,

Denys Nykula <vegan@libre.net.ua> writes:
> +         (native-console-font (match (getenv "LANGUAGE")
> +                                ((or "be" "bg" "el" "eo" "kk" "ky"
> +                                     "mk" "mn" "ru" "sr" "tg" "uk")
> +                                 "LatGrkCyr-8x16.psfu.gz")

Works very well.  I prefer however to change this to just
"LatGrkCyr-8x16" which works too and is what’s used in the Guix manual’s
example for configuring console-font-service-type.

Will push on Friday.

Regards,
Florian
Josselin Poiret July 6, 2023, 8:56 a.m. UTC | #2
Hi Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> writes:

> Pryvit Denys,
>
> Denys Nykula <vegan@libre.net.ua> writes:
>> +         (native-console-font (match (getenv "LANGUAGE")
>> +                                ((or "be" "bg" "el" "eo" "kk" "ky"
>> +                                     "mk" "mn" "ru" "sr" "tg" "uk")
>> +                                 "LatGrkCyr-8x16.psfu.gz")
>
> Works very well.  I prefer however to change this to just
> "LatGrkCyr-8x16" which works too and is what’s used in the Guix manual’s
> example for configuring console-font-service-type.

Tested this as well, works quite nice!  Please go ahead :)

Best,
pelzflorian July 6, 2023, 2:27 p.m. UTC | #3
Pushed as 961ffca1c75141cbb351d143b22b673638e9659d.

Great work. :)

Regards,
Florian
diff mbox series

Patch

diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm
index d08bab47fd..a0ac2f35d3 100644
--- a/gnu/installer/services.scm
+++ b/gnu/installer/services.scm
@@ -4,6 +4,7 @@ 
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2023 Denys Nykula <vegan@libre.net.ua>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,6 +24,7 @@ 
 (define-module (gnu installer services)
   #:use-module (guix records)
   #:use-module (guix read-print)
+  #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
   #:export (system-service?
             system-service-name
@@ -159,6 +161,19 @@  (define (system-services->configuration services)
          (base     (if desktop?
                        '%desktop-services
                        '%base-services))
+         (native-console-font (match (getenv "LANGUAGE")
+                                ((or "be" "bg" "el" "eo" "kk" "ky"
+                                     "mk" "mn" "ru" "sr" "tg" "uk")
+                                 "LatGrkCyr-8x16.psfu.gz")
+                                (_ #f)))
+         (services (if native-console-font
+                       `(modify-services ,base
+                          (console-font-service-type
+                           config => (map (lambda (tty)
+                                            (cons (car tty)
+                                                  ,native-console-font))
+                                          config)))
+                       base))
          (service-heading (list (vertical-space 1)
                                 (comment (G_ "\
 ;; Below is the list of system services.  To search for available
@@ -177,7 +192,7 @@  (define (system-services->configuration services)
                                     %base-packages))))
 
           ,@service-heading
-          (services ,base))
+          (services ,services))
         `(,@(if (null? packages)
                 '()
                 `(,@package-heading
@@ -199,4 +214,4 @@  (define (system-services->configuration services)
                             ,(comment (G_ "\
 ;; This is the default list of services we
 ;; are appending to.\n"))
-                            ,base))))))
+                            ,services))))))