diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2023-02-28 23:11:08 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2023-02-28 23:32:17 +0800 |
commit | 4b5abb8a21658623be26e1ad03712e65cae5a415 (patch) | |
tree | dcf7511a6013c62d103d5bf92e2e2b83be180fec /mpd/ncmpcpp/cover.sh | |
parent | fadb9706c50894058d71738d4dfc508c6922ee9a (diff) |
Add ncmpcpp layout
ref: https://radumirea.com/blog/ncmpcpp-with-album-art
Diffstat (limited to 'mpd/ncmpcpp/cover.sh')
-rwxr-xr-x | mpd/ncmpcpp/cover.sh | 18 |
1 files changed, 18 insertions, 0 deletions
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 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | source "`ueberzug library`" | ||
4 | COVER="/tmp/album_cover.png" | ||
5 | |||
6 | function add_cover { | ||
7 | ImageLayer::add [identifier]="img" [x]="2" [y]="1" [path]="$COVER" | ||
8 | } | ||
9 | |||
10 | ImageLayer 0< <( | ||
11 | if [ ! -f "$COVER" ]; then | ||
12 | cp "$HOME/.ncmpcpp/default_cover.png" "$COVER" | ||
13 | fi | ||
14 | #rerender image when changed | ||
15 | while inotifywait -q -q -e close_write "$COVER"; do | ||
16 | add_cover | ||
17 | done | ||
18 | ) | ||