diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-11-07 11:32:27 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-11-07 11:32:27 +0800 |
commit | 71ca28742ac4f93ab2401eaee8e78471c023cd4b (patch) | |
tree | dd7c3921d249151dc3179f015153b9f9833d9d73 /X11/mpd/ncmpcpp/cover.sh | |
parent | c7ed81e664a592db8fc9a9a6e8f44843de8024a1 (diff) |
Update
Diffstat (limited to 'X11/mpd/ncmpcpp/cover.sh')
-rwxr-xr-x | X11/mpd/ncmpcpp/cover.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/X11/mpd/ncmpcpp/cover.sh b/X11/mpd/ncmpcpp/cover.sh new file mode 100755 index 0000000..8fe8d4d --- /dev/null +++ b/X11/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 | ) | ||