added: scripts from @zethra's configs, and tidied flake structure lili bit
This commit is contained in:
parent
b0a649e560
commit
9a3fbee8bb
25 changed files with 230 additions and 0 deletions
27
home/scripts/zethra/speak-clipboard
Executable file
27
home/scripts/zethra/speak-clipboard
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh
|
||||
|
||||
PIDFILE='/tmp/speak.pid'
|
||||
|
||||
if [ -f "$PIDFILE" ]; then
|
||||
PID=$(cut -f 1 $PIDFILE)
|
||||
DIR=$(cut -f 2 $PIDFILE)
|
||||
kill "$PID"
|
||||
rm -f "$PIDFILE"
|
||||
rm -rf "$DIR"
|
||||
else
|
||||
DIR=`mktemp -d`
|
||||
xclip -sel clip -o > "$DIR/text"
|
||||
RHVoice-test -r 140 -i "$DIR/text" -o "$DIR/out.wav"
|
||||
mpv "$DIR/out.wav" &
|
||||
# set -m
|
||||
# festival --tts < "$DIR/text" &
|
||||
PID="$!"
|
||||
# set +m
|
||||
echo "Making pid file, $PID $PIDFILE"
|
||||
printf "$PID\t$DIR" > "$PIDFILE"
|
||||
wait $(jobs -p)
|
||||
echo "Speech done"
|
||||
rm -rf "$DIR"
|
||||
rm -f "$PIDFILE"
|
||||
fi
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue