From 316594518659ea49ce4b4c53e8a24dc50833cc35 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Sat, 3 Jul 2021 13:28:51 -0300 Subject: [PATCH] Add template unit file This allows the user to start espeakup service from the command-line interface setting a specific voice/language without needing to edit the unit file, which could be complicated for blind or visually impaired users that do not understand English enough to hear English espeakup before setting it to the desired language. Example usage: systemd start espeakup@pt --- services/systemd/espeakup@.service.in | 18 ++++++++++++++++++ services/systemd/meson.build | 8 +++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 services/systemd/espeakup@.service.in diff --git a/services/systemd/espeakup@.service.in b/services/systemd/espeakup@.service.in new file mode 100644 index 0000000..efe9ff0 --- /dev/null +++ b/services/systemd/espeakup@.service.in @@ -0,0 +1,18 @@ +[Unit] +Description=Software speech output for Speakup +Documentation=man:espeakup(8) +Wants=modprobe@speakup_soft.service +After=modprobe@speakup_soft.service sound.target +Conflicts=espeakup.service + +[Service] +Type=forking +PIDFile=/run/espeakup.pid +ExecStart=@bindir@/espeakup --default-voice=%I +ExecReload=kill -HUP $MAINPID +Restart=always +Nice=-10 +OOMScoreAdjust=-900 + +[Install] +WantedBy=sound.target diff --git a/services/systemd/meson.build b/services/systemd/meson.build index 9ae652e..f51d44f 100644 --- a/services/systemd/meson.build +++ b/services/systemd/meson.build @@ -11,6 +11,12 @@ service_file = configure_file( configuration : unit_conf ) -install_data(service_file, +user_service_file = configure_file( + input : 'espeakup@.service.in', + output : 'espeakup@.service', + configuration : unit_conf +) + +install_data(service_file, user_service_file, install_dir : unitdir )