update ncspot notification

This commit is contained in:
2025-09-23 18:21:37 -07:00
parent f2fa6a95d3
commit e19e5d2c10
3 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
notify=false
notify=true
[notification_format]
body = "%album\n%artists"
+7 -1
View File
@@ -1,6 +1,6 @@
killall -q playerctl
# delete all the copied image files first
find "$HOME/.cache/ncspot/" -type f -exec sh -c 'file -b --mime-type "$0" | grep -q "^image/" && rm "$0"' {} \;
find "$HOME/.config/ncspot/" -type f -exec sh -c 'file -b --mime-type "$0" | grep -q "^image/" && rm "$0"' {} \;
playerctl metadata --follow --format '{{ mpris:trackid }}' | while read -r line; do
title=$(playerctl metadata title)
album=$(playerctl metadata album)
@@ -11,8 +11,14 @@ playerctl metadata --follow --format '{{ mpris:trackid }}' | while read -r line;
if [[ -n $ap ]]; then
cfp="$HOME/.cache/ncspot/covers/$ap"
# should have a timeout
counter=0
until [ -e $cfp ]; do
sleep 1
# counter=$((counter + 1))
# if [ "$counter" -eq 60 ]; then
# break
# fi
done
MIME_TYPE=$(file -b --mime-type "$cfp")
SUB_TYPE=$(echo "$MIME_TYPE" | cut -d'/' -f2)