Cover with path in filename cause notification not displayed

This commit is contained in:
Yorick Barbanneau 2023-03-21 16:10:54 +01:00
parent d59f31a62b
commit aca00a2e6c

View file

@ -2,8 +2,9 @@
# #
#CMUS notification #CMUS notification
# #
options="--app-name=cmus" set -x
body="" body=""
while [ "$#" -ge 2 ] while [ "$#" -ge 2 ]
do do
eval $1='$2' eval $1='$2'
@ -11,9 +12,9 @@ do
shift shift
done done
filename=${file##*/} filename=${file#*/}
image=${file%/*}/cover.jpg image=${file%/*}/cover.jpg
[ -f "$image" ] && options="$options -i ${image}" [ -f "$image" ] && options="$options -i \"${image}\""
title=${title:-$filename} title=${title:-$filename}
@ -32,5 +33,5 @@ then
body="$body ${date%%-*}" body="$body ${date%%-*}"
fi fi
body=${body:-'no informations'} body=${body:-'no informations'}
echo "$options" > ~/cmus.txt
notify-send $options "$title" "$body" notify-send --app-name=cmus -i "$image" "$title" "$body" > ~/cmus.txt