From 93ddae21ac250ee648365771f33fa21bb24bd415 Mon Sep 17 00:00:00 2001 From: boredpasta Date: Mon, 17 Jul 2023 16:43:23 +0300 Subject: mpc-notify: directly test command exit status --- mpc-notify | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mpc-notify') diff --git a/mpc-notify b/mpc-notify index 21d94c6..abf9adf 100755 --- a/mpc-notify +++ b/mpc-notify @@ -127,9 +127,9 @@ if [ "$use_preview" -eq 1 ]; then song_icon="$preview_path" else song_dirname=$(dirname "$song_filename") - art_filename="$(find "$song_dirname" -type f | + if art_filename="$(find "$song_dirname" -type f | grep -Esm 1 '.*\.(jpg|png)')" - if [ $? -eq 0 ]; then + then # or use scaled cover art from directory ffmpeg -y -i "$art_filename" -an -vf \ scale="${preview_width}:${preview_height}" \ -- cgit v1.2.3