From 4b5abb8a21658623be26e1ad03712e65cae5a415 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Tue, 28 Feb 2023 23:11:08 +0800 Subject: Add ncmpcpp layout ref: https://radumirea.com/blog/ncmpcpp-with-album-art --- mpd/ncmpcpp/cover.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 mpd/ncmpcpp/cover.sh (limited to 'mpd/ncmpcpp/cover.sh') diff --git a/mpd/ncmpcpp/cover.sh b/mpd/ncmpcpp/cover.sh new file mode 100755 index 0000000..8fe8d4d --- /dev/null +++ b/mpd/ncmpcpp/cover.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +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/.ncmpcpp/default_cover.png" "$COVER" +fi +#rerender image when changed +while inotifywait -q -q -e close_write "$COVER"; do + add_cover +done +) -- cgit v1.2.3-70-g09d2