From patchwork Sat Oct 15 15:09:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hunter Jozwiak X-Patchwork-Id: 43428 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3097727BBEA; Sat, 15 Oct 2022 16:11:36 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D1A8D27BBE9 for ; Sat, 15 Oct 2022 16:11:34 +0100 (BST) Received: from localhost ([::1]:60634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojip3-0000UI-HE for patchwork@mira.cbaines.net; Sat, 15 Oct 2022 11:11:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojioo-0000TC-NT for guix-patches@gnu.org; Sat, 15 Oct 2022 11:11:18 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ojioX-0002SR-Sd for guix-patches@gnu.org; Sat, 15 Oct 2022 11:11:12 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ojioX-0001jG-NK for guix-patches@gnu.org; Sat, 15 Oct 2022 11:11:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58528] [PATCH] gnu: Services: Add espeakup service. Resent-From: Hunter Jozwiak Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 Oct 2022 15:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58528 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58528@debbugs.gnu.org Received: via spool by 58528-submit@debbugs.gnu.org id=B58528.16658466026550 (code B ref 58528); Sat, 15 Oct 2022 15:11:01 +0000 Received: (at 58528) by debbugs.gnu.org; 15 Oct 2022 15:10:02 +0000 Received: from localhost ([127.0.0.1]:42450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojinY-0001hC-V5 for submit@debbugs.gnu.org; Sat, 15 Oct 2022 11:10:02 -0400 Received: from mail-lj1-f173.google.com ([209.85.208.173]:40463) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojinW-0001gw-Jk for 58528@debbugs.gnu.org; Sat, 15 Oct 2022 11:09:59 -0400 Received: by mail-lj1-f173.google.com with SMTP id c20so9199330ljj.7 for <58528@debbugs.gnu.org>; Sat, 15 Oct 2022 08:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :from:to:cc:subject:date:message-id:reply-to; bh=MD5q8EiTGTjgygMLUVkLvwp1HDR3IBv7GatTRSVcPes=; b=lH5dpzrROSiqiuc5UtIc7DVQiowRuMoaRPQkqs2u8ff6KbYBCied3r3dCsKRlQawNl p3qm8zRuPo6rPjjq02dQtVfuM7aZwaiHkYgg8XGqO/Skbp6Xt9ZmPyT5Z3llWFFJoK/c ZzTvKk5dof77XLsKDds2pmzhwUcaani8gcsAsl7nrrIUgyPWnPrO51v/6ekoC0Vr8Gb1 BcqyqGzd6C5503C48/wAIu+S0POQZoYlPj8O/6BTwO3cYY5E9m2F89OR+A4zjnxWSIGL JctyQGyBBluNQ4pPxLibzF0DTgLW8uLfSJ3omEAR/L8faNG/yjSQQY8SzJa6D8bUGuSa aA1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MD5q8EiTGTjgygMLUVkLvwp1HDR3IBv7GatTRSVcPes=; b=dzvE/G6CPpproVh+PYejO95XAczUVK/vPNOgAvayWzR3CTS2BuPbSeFd7+wQkt/MGc 8vBJ6UJUfWuoeVRXKb81UUZGpNxMCQt8btwbg/XTwM2cq1SP7T1p1xpxroqYbHIXnrc3 oMoY9xe7hJ9F3cb+aDeh22tUH9Vezxu2aUiWNi5hD6dNmA+JtjvZWYbb1QpkTHvr0oQ9 15abh4wns8UBpAwJXQ1vZh/IAtMpFo77j6TScreidSqnHHTXQsBdH//0qg07jvoOGaeH XhKCUvhGrbJ98FIXmmFQ0pKxHkRvLfTTCWUWtCge/ZDiVQz8PyPaKnkQYdMCQVMqUS/R pwpw== X-Gm-Message-State: ACrzQf1eURoPEMlEmnAZUntBASTqOwdZTVlBoyhnTdE1YlMwGKhSPfzU LO5+DcO9fBDUKfzLP65q6kafSvA07lOgx8H6CJ0KucaBQm8= X-Google-Smtp-Source: AMsMyM5Iaol10s34spN1UI6qM93WnbKIT/eAywxl9sBXhiekPSmgIKaK5lYEEwMQWDvWGKGX0vW1YDa2hbk70RB0xr8= X-Received: by 2002:a2e:9547:0:b0:26b:fb41:f60a with SMTP id t7-20020a2e9547000000b0026bfb41f60amr1188947ljh.295.1665846591388; Sat, 15 Oct 2022 08:09:51 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 15 Oct 2022 08:09:48 -0700 From: Hunter Jozwiak In-Reply-To: References: MIME-Version: 1.0 Date: Sat, 15 Oct 2022 08:09:48 -0700 Message-ID: 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches "(" writes: Heya, > > On Fri Oct 14, 2022 at 9:09 PM BST, wrote: >> >> diff –git a/doc/guix.texi b/doc/guix.texi index dbf4ca9be9..73dc647ca5 >> 100644 — a/doc/guix.texi + b/doc/guix.texi @@ -17572,6 +17572,7 @@ >> Services >> >> @menu * Base Services:: Essential system services. +* Accessibility >> Services:: For those with various impairments. * Scheduled Job Execution:: >> The mcron service. * Log Rotation:: The rottlog service. * Networking >> Setup:: Setting up network interfaces. @@ -18793,6 +18794,24 @@ Base >> Services (local-file "sway-greetd.conf")))))))) @end lisp @end deftp +@node >> Accessibility Services +@subsection Accessibility Services >> +%espeakup-configuration +@c %start of fragment + +@deftp {Data Type} >> espeakup-configuration +Available @code{espeakup-configuration} fields are: >> + +@table @asis +@item @code{default-voice} (default: @code{"en-US"}) >> (type: string) +Set the voice that espeak-ng should use by default. + +@end >> table + +@end deftp + + +@c %end of fragment >> > > Remember to add your copyright notice to the manual's copyright section. > > + (define-module (gnu services accessibility) >> > > Since this is a new file, you'll need to update ``gnu/local.mk'' > accordingly. > > + >> > > Remove this empty line after the ``;;; Copyright …'' line. > > + #:export (espeakup-configuration espeakup-service-type)) >> > > You should probably put each variable here on a new line. > > + +;; Espeakup service >> > > Instead of this, do this: > > ^L ;;; ;;; Espeakup. ;;; > > The ^L is a control character, not a literal ``L''. Look at one of the > other files and copy their ^L in. Also, add another newline after this > "section comment". > > +(define-configuration/no-serialization espeakup-configuration + >> (default-voice (string "en-US") + "Set the voice that espeak-ng should use >> by default.")) >> > > Funky indentation here, and there needs to be a field for customizing the > ``espeakup'' package to use. Should be: > > (define-configuration/no-serialization espeakup-configuration (espeakup > (file-like espeakup) "Set the package providing the @code{/bin/espeakup} > command.") (default-voice (string "en-US") "Set the voice that espeak-ng > should use by default.")) > > +(define (espeakup-shepherd-service config) + (list (shepherd-service >> (provision '(espeakup)) + (documentation "The espeak-ng bridge to >> speakup.") + (requirement '(user-processes)) + (start >> #~(make-forkexec-constructor (list (string-append #[image: $espeakup >> >> + >> /bin/espeakup >> >> + -v >> + >> #$](espeakup-configuration-default-voice >> >>> >>> + config))))) + (stop #~(make-kill-destructor))))) >>>> >>> >>> Again, indentation is off here, and there's a small issue with >>> ``string-append'' being used where ``file-append'' should be. Try this >>> instead: >>> >>> (define (espeakup-shepherd-service config) (list (shepherd-service >>> (provision '(espeakup)) (requirement '(user-processes)) (documentation "Run >>> espeakup, the espeak-ng bridge to speakup.") (start >>> #~(make-forkexec-constructor (list #[image: $(file-append >>> (espeakup-configuration-espeakup config) > >>> /bin/espeakup) > -v #$](espeakup-configuration-default-voice >>> config)))) >>>> >>>> (stop #~(make-kill-destructor))))) >>>> >>>> +(define espeakup-service-type + (service-type (name 'espeakup) + >>>>> (description + "A lightweight connector between espeak and speakup.") + >>>>> (extensions (list (service-extension + shepherd-root-service-type + >>>>> espeakup-shepherd-service) + (service-extension + >>>>> kernel-module-loader-service-type + (const (list "speakupsoft"))))) + >>>>> (default-value (espeakup-configuration)))) >>>>> >>>> >>>> Here too; try this: >>>> >>>> (define espeakup-service-type (service-type (name 'espeakup) >>>> (extensions (list (service-extension shepherd-root-service-type >>>> espeakup-shepherd-services) (service-extension >>>> kernel-module-loader-service-type (const (list "speakupsoft"))))) >>>> (default-value (espeakup-configuration)) (description "Configure and run >>>> espeakup, a lightweight bridge between espeak-ng and speakup."))) >>>> >>>> – ( >>>> >>> From 6e9a454aa4f69c19c2e0bb4b109b4e86bb627a60 Mon Sep 17 00:00:00 2001 Message-Id: <6e9a454aa4f69c19c2e0bb4b109b4e86bb627a60.1665846418.git.hunter.t.joz@gmail.com> From: Hunter Jozwiak Date: Fri, 14 Oct 2022 15:45:21 -0400 Subject: [PATCH] gnu: Services: Add espeakup service. * gnu/services/accessibility.scm: add espeakup-configuration, espeakup-shepherd-service, and espeakup-service-type. * gnu/local.mk: wire it in. * doc/guix.texi (Accessibility Services): Document the espeakup configuration. --- doc/guix.texi | 23 ++++++++++++ gnu/local.mk | 2 ++ gnu/services/accessibility.scm | 66 ++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 gnu/services/accessibility.scm diff --git a/doc/guix.texi b/doc/guix.texi index bdff4004d0..b9633f0ae5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -109,6 +109,7 @@ Copyright @copyright{} 2022 Simon Streit@* Copyright @copyright{} 2022 (@* Copyright @copyright{} 2022 John Kehayias@* +Copyright @copyright{} 2022 Hunter Jozwiak@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -17585,6 +17586,7 @@ Services @menu * Base Services:: Essential system services. +* Accessibility Services:: For those with various impairments. * Scheduled Job Execution:: The mcron service. * Log Rotation:: The rottlog service. * Networking Setup:: Setting up network interfaces. @@ -18806,6 +18808,27 @@ Base Services (local-file "sway-greetd.conf")))))))) @end lisp @end deftp +@node Accessibility Services +@subsection Accessibility Services +%espeakup-configuration +@c %start of fragment + +@deftp {Data Type} espeakup-configuration +Available @code{espeakup-configuration} fields are: + +@table @asis +@item @code{espeakup} (default: @code{espeakup}) (type: file-like) +Set the package providing the @code{/bin/espeakup} command. + +@item @code{default-voice} (default: @code{"en-US"}) (type: string) +Set the voice that espeak-ng should use by default. + +@end table + +@end deftp + + +@c %end of fragment @node Scheduled Job Execution @subsection Scheduled Job Execution diff --git a/gnu/local.mk b/gnu/local.mk index 1bd4722db4..ce0dcbb301 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -55,6 +55,7 @@ # Copyright © 2022 Hilton Chain # Copyright © 2022 Alex Griffin # Copyright © 2022 ( +# Copyright © 2022 Hunter Jozwiak # # This file is part of GNU Guix. # @@ -643,6 +644,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/zwave.scm \ \ %D%/services.scm \ + %D%/services/accessibility.scm \ %D%/services/admin.scm \ %D%/services/audio.scm \ %D%/services/auditd.scm \ diff --git a/gnu/services/accessibility.scm b/gnu/services/accessibility.scm new file mode 100644 index 0000000000..7c29c7fec6 --- /dev/null +++ b/gnu/services/accessibility.scm @@ -0,0 +1,66 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Hunter Jozwiak +;;; +;;; 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 services accessibility) + #:use-module (gnu packages accessibility) + #:use-module (gnu services) + #:use-module (gnu services configuration) + #:use-module (gnu services linux) + #:use-module (gnu services shepherd) + #:use-module (guix gexp) + #:use-module (guix records) + #:export (espeakup-configuration + espeakup-service-type)) + + +;;; +;;; Espeakup + +(define-configuration/no-serialization espeakup-configuration + (espeakup + (file-like espeakup) + "Set the package providing the @code{/bin/espeakup} command.") + (default-voice + (string "en-US") + "Set the voice that espeak-ng should use by default.")) + +(define (espeakup-shepherd-service config) + (list (shepherd-service + (provision '(espeakup)) + (requirement '(user-processes)) + (documentation "Run espeakup, the espeak-ng bridge to speakup.") + (start + #~(make-forkexec-constructor + (list #$(file-append (espeakup-configuration-espeakup config) + "/bin/espeakup") + "-v" #$(espeakup-configuration-default-voice config)))) + (stop #~(make-kill-destructor))))) + +(define espeakup-service-type + (service-type + (name 'espeakup) + (extensions + (list (service-extension + shepherd-root-service-type + espeakup-shepherd-service) + (service-extension + kernel-module-loader-service-type + (const (list "speakup_soft"))))) + (default-value (espeakup-configuration)) + (description + "Configure and run espeakup, a lightweight bridge between espeak-ng and speakup."))) -- 2.38.0