From 3920bbc24739d993863de93ac781bfb2b2626706 Mon Sep 17 00:00:00 2001 From: lshprung Date: Fri, 31 Jul 2020 14:37:38 -0700 Subject: First Commit --- show_album_art.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 show_album_art.sh (limited to 'show_album_art.sh') diff --git a/show_album_art.sh b/show_album_art.sh new file mode 100755 index 0000000..3fa04f3 --- /dev/null +++ b/show_album_art.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +SONG="$(mocp -i | head -n 2 | tail -n 1 | cut -c 7-)" +RUN=0 +echo $RUN +if [ -z "$SONG" ] || [ ! -e "$SONG" ]; then + echo "mocp is not currently running or is stopped" + exit +fi +ffmpeg -y -i "$SONG" /tmp/now_playing.jpg +sxiv -b -s f /tmp/now_playing.jpg & +PID=$(echo $!) + +while [[ "$RUN" == "0" ]]; do + if [[ $SONG != "$(mocp -i | head -n 2 | tail -n 1 | cut -c 7-)" ]]; then + SONG="$(mocp -i | head -n 2 | tail -n 1 | cut -c 7-)" + ffmpeg -y -i "$SONG" /tmp/now_playing.jpg & + fi + sleep 1 + RUN=$(ps --pid $PID; echo $?) + RUN=$(echo $RUN | rev | cut -c 1) +done -- cgit