From bb348f3e9eaaea0a4ac2eaab9956c1e640b273bd Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 3 Dec 2017 10:55:15 -0500 Subject: [PATCH] Tried to make lyrics stop in a sane position, instead of with the first word of a sentence, or in the middle of a sentence, etc. --- modules/sing/sing.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/sing/sing.sh b/modules/sing/sing.sh index 85eae59..00ff0aa 100755 --- a/modules/sing/sing.sh +++ b/modules/sing/sing.sh @@ -4,10 +4,10 @@ shift chan="$1" shift #get the lyric text into a variable -lyricText="$(clyrics $@ | tr '[:space:]' ' ' | tr -s ' ' | fold -s -w 256)" +lyricText="$(clyrics $@ | tr '[:space:]' ' ' | tr -s ' ' | fold -s -w 384)" i=$(echo "$lyricText" | wc -l) i=$(($RANDOM % $i + 1)) -lyricText="$(echo "$lyricText" | tail +$i | head -1)" +lyricText="$(echo "$lyricText" | tail +$i | head -1 | rev | cut -d '.' -f2- | rev)" #Display the lyric text if [ ${#lyricText} -gt 15 ] ; then msg "$chan" "${lyricText}"