Skip to content

Commit

Permalink
Use flatpak-spawn to trigger a speech-dispatcher restart when running…
Browse files Browse the repository at this point in the history
… within flatpak
  • Loading branch information
Elleo committed Nov 23, 2023
1 parent 82d6cc1 commit 50d193a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions flatpak/com.mikeasoft.pied.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ finish-args:
- --socket=pulseaudio
- --share=network
- --filesystem=home
- --talk-name=org.freedesktop.Flatpak
modules:
- name: Pied
buildsystem: simple
Expand Down
12 changes: 10 additions & 2 deletions lib/voice_selector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,16 @@ class _VoiceSelectorState extends State<VoiceSelector> {
configString.replaceAll(
"LANGUAGE", voice.value[1]);
modelConf.writeAsString(configString);
Process.runSync(
"killall", ["speech-dispatcher"]);
if (isFlatpak()) {
Process.runSync("flatpak-spawn", [
"--host",
"killall",
"speech-dispatcher"
]);
} else {
Process.runSync("killall",
["speech-dispatcher"]);
}
setState(() {
currentVoice = voice.value[3];
});
Expand Down

0 comments on commit 50d193a

Please sign in to comment.