summaryrefslogtreecommitdiff
path: root/.config/ncmpcpp/cover.sh
diff options
context:
space:
mode:
Diffstat (limited to '.config/ncmpcpp/cover.sh')
-rwxr-xr-x.config/ncmpcpp/cover.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/.config/ncmpcpp/cover.sh b/.config/ncmpcpp/cover.sh
new file mode 100755
index 0000000..2a895b4
--- /dev/null
+++ b/.config/ncmpcpp/cover.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env sh
+
+######################################################################
+# @author : pico (pico@$HOSTNAME)
+# @file : cover
+# @created : Sunday Sep 08, 2024 00:48:44 CST
+#
+# @description :
+######################################################################
+
+source "`ueberzug library`"
+COVER="/tmp/album_cover.png"
+
+function add_cover {
+ ImageLayer::add [identifier]="img" [x]="2" [y]="1" [path]="$COVER"
+}
+
+ImageLayer 0< <(
+if [ ! -f "$COVER" ]; then
+ cp "$HOME/.config/ncmpcpp/default_cover.png" $COVER"
+fi
+
+# rerender image when changed
+while inotifywait -q -q -e close_write "$COVER"; do
+ add_cover
+done
+)