diff options
author | garhve <git@garhve.com> | 2024-09-16 11:47:28 +0800 |
---|---|---|
committer | garhve <git@garhve.com> | 2024-09-16 11:47:28 +0800 |
commit | bcfda983efdd527f75de54c35f5366f23e774233 (patch) | |
tree | 13df9f98cd06f78dbfa666b0e0e834346c76c247 /.config/ncmpcpp/cover.sh |
initialize
Diffstat (limited to '.config/ncmpcpp/cover.sh')
-rwxr-xr-x | .config/ncmpcpp/cover.sh | 27 |
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 +) |