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