From aca00a2e6c0637a7255aeb96c0b1688045377481 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneauwq Date: Tue, 21 Mar 2023 16:10:54 +0100 Subject: [PATCH] Cover with path in filename cause notification not displayed --- files/config/cmus/notify.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/files/config/cmus/notify.sh b/files/config/cmus/notify.sh index 3a985d0..ea1cf8d 100755 --- a/files/config/cmus/notify.sh +++ b/files/config/cmus/notify.sh @@ -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