aboutsummaryrefslogtreecommitdiffstats
path: root/.config/cmus/cover-art/display.sh
diff options
context:
space:
mode:
Diffstat (limited to '.config/cmus/cover-art/display.sh')
-rw-r--r--.config/cmus/cover-art/display.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/.config/cmus/cover-art/display.sh b/.config/cmus/cover-art/display.sh
new file mode 100644
index 0000000..739ff07
--- /dev/null
+++ b/.config/cmus/cover-art/display.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+CURRENT_DIR=`dirname "$BASH_SOURCE"`
+COVERS_DIR="$CURRENT_DIR/.cover"
+
+PREVIOUS=""
+CURRENT=""
+
+IMAGE_VIEWER="$CURRENT_DIR/imagemagick"
+
+clear
+while (true)
+do
+ CURRENT=$(ls ${COVERS_DIR})
+ if [ "$CURRENT" != "$PREVIOUS" ]
+ then
+ pkill -TERM -P $$
+ clear
+ if [ "$CURRENT" != "" ]
+ then
+ PREVIOUS=$CURRENT
+ $IMAGE_VIEWER $COVERS_DIR/$CURRENT &
+ else
+ echo "::: NO COVER ART :::"
+ PREVIOUS=""
+ fi
+ fi
+ sleep 1
+done
+