[CONKY] Fix problem in regexp

This commit is contained in:
Gregory Trolliet 2020-05-30 10:18:43 +02:00
parent c9305b52f5
commit 0e4fd49efe

View file

@ -263,11 +263,11 @@ language+=([goyu]="Taiwanese Mandarin");
if cmus-remote -Q &>/dev/null ; then if cmus-remote -Q &>/dev/null ; then
COMMENT=$( cmus-remote -Q | grep "tag comment " | cut -d " " -f 3- ) COMMENT=$( cmus-remote -Q | grep "tag comment " | cut -d " " -f 3- )
LANGUAGE=$( echo $COMMENT | sed 's/.*lang:\(.\{2,4\}\).*/\1/') LANGUAGE=$( echo $COMMENT | sed 's/.*lang:\([^,]\{2,4\}\).*/\1/')
if [ "$LANGUAGE" = "$COMMENT" ]; then if [ "$LANGUAGE" = "$COMMENT" ]; then
LANGUAGE=""; LANGUAGE="";
fi fi
COUNTRY=$( echo $COMMENT | sed 's/.*country:\(.\{2\}\).*/\1/') COUNTRY=$( echo $COMMENT | sed 's/.*country:\([^.]\{2\}\).*/\1/')
if [ ! -z "$LANGUAGE" ] && [ ! -z "$COUNTRY" ]; then if [ ! -z "$LANGUAGE" ] && [ ! -z "$COUNTRY" ]; then
echo "${language[$LANGUAGE]}, ${country[$COUNTRY]}" echo "${language[$LANGUAGE]}, ${country[$COUNTRY]}"
elif [ ! -z "$LANGUAGE" ]; then elif [ ! -z "$LANGUAGE" ]; then