commit b8c7ff62b87a82ab03720dec10bd8eb457f3f32d Author: Yuval Langer <yuvallangerontheroad@gmail.com> Date: Wed, 24 Nov 2021 23:20:38 +0200 First commit. Diffstat:
A | my-speak | | | 14 | ++++++++++++++ |
A | my-speak-kill | | | 6 | ++++++ |
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/my-speak b/my-speak @@ -0,0 +1,14 @@ +#!/bin/sh + +myspeakdir="$HOME/.my-speak" +lockfilepath="$myspeakdir/lock" +pidfilepath="$myspeakdir/pid" +pipefile="$myspeakdir/text_named_pipe" +speakngpath="$(which speak-ng)" + +mkdir -p "$myspeakdir" +mkfifo --mode=600 "$pipefile" + +xsel -p | tr '\n' ' ' > "$pipefile" & + +daemonize -l "$lockfilepath" -p "$pidfilepath" "$speakngpath" -f "$pipefile" diff --git a/my-speak-kill b/my-speak-kill @@ -0,0 +1,6 @@ +#!/bin/sh + +myspeakdir="$HOME/.my-speak/" +pidfilepath="$myspeakdir/pid" + +kill "$(cat "$pidfilepath")"