From 0b7308c9a6e1c6eed6f5d26ddb562b96f985d82d Mon Sep 17 00:00:00 2001 From: rany Date: Tue, 11 May 2021 16:03:42 +0300 Subject: [PATCH] Simplify usage --- .gitignore | 2 ++ easy-playback.sh | 7 +++++++ install.sh | 9 +++++++++ 3 files changed, 18 insertions(+) create mode 100755 easy-playback.sh create mode 100755 install.sh diff --git a/.gitignore b/.gitignore index 4faea6c..ebe9280 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ ** +!install.sh +!easy-playback.sh !edge-tts.py !LICENSE !sample diff --git a/easy-playback.sh b/easy-playback.sh new file mode 100755 index 0000000..bec5c34 --- /dev/null +++ b/easy-playback.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +## To use this script you need to install +## edge-tts.py to a directory in your $PATH +## as executable and give it the name edge-tts +trap 'kill -- $(jobs -p) 2>/dev/null' EXIT +exec {fd}< <(edge-tts "${@}") +mpg123 -C "/dev/fd/$fd" diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..a8926b7 --- /dev/null +++ b/install.sh @@ -0,0 +1,9 @@ +#!/bin/sh +{ [ -e "edge-tts.py" ] && [ -e "easy-playback.sh" ]; } || { echo "Script needs to be run on root of the repo" >&2; exit 1; } +[ -z "$1" ] && { echo "You need to specify the install path." >&2; exit 1; } +mkdir -p -- "$1" 2>/dev/null +rm -f -- "$1/edge-tts" "$1/easy-playback" +cp -f -- edge-tts.py "$1/edge-tts" +cp -f -- easy-playback.sh "$1/edge-playback" +chmod +x -- "$1/edge-tts" "$1/edge-playback" +exit 0