diff options
author | Joe <rrbo@proton.me> | 2023-02-06 17:30:54 +0100 |
---|---|---|
committer | Joe <rrbo@proton.me> | 2023-02-06 17:30:54 +0100 |
commit | 705c86604032658d5ab2fd1697ebfa5d2aef5b38 (patch) | |
tree | 5225a68a0234dfa7cf79a0ff8fc488adad0e1df8 /.local/bin/conky/cover.sh | |
parent | up (diff) | |
download | dotfiles-bsd-705c86604032658d5ab2fd1697ebfa5d2aef5b38.tar.gz dotfiles-bsd-705c86604032658d5ab2fd1697ebfa5d2aef5b38.tar.bz2 dotfiles-bsd-705c86604032658d5ab2fd1697ebfa5d2aef5b38.tar.xz dotfiles-bsd-705c86604032658d5ab2fd1697ebfa5d2aef5b38.tar.zst dotfiles-bsd-705c86604032658d5ab2fd1697ebfa5d2aef5b38.zip |
up
Diffstat (limited to '.local/bin/conky/cover.sh')
-rwxr-xr-x | .local/bin/conky/cover.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/.local/bin/conky/cover.sh b/.local/bin/conky/cover.sh index ffdd403..c9fba97 100755 --- a/.local/bin/conky/cover.sh +++ b/.local/bin/conky/cover.sh @@ -13,7 +13,7 @@ # API Key for Last.fm # APIKEY="b25b959554ed76058ac220b7b2e0a026" # Log file, only for debugging purposes -LOG=/tmp/conky-mpd.log +# LOG=/tmp/conky-mpd.log TMP=/tmp/conkympd.tmp # Check for vital commands @@ -24,17 +24,17 @@ TMP=/tmp/conkympd.tmp # [ ! -d "$CACHE" ] && mkdir -p "$CACHE" playing="$(mpc --format '%artist% - %album%' | head -1)" -filedir="$(dirname "$XDG_MUSIC_DIR/$(mpc --format %file% | head -n1)")" [ ! -f $TMP ] && touch $TMP -[ "$(cat $TMP)" == "$playing" ] && exit 0 -# [ "$(cat $TMP)" == "$playing" ] && echo "Same artist/album" >> $LOG && exit 0 +[ "$(cat $TMP)" = "$playing" ] && exit 0 +# [ "$(cat $TMP)" = "$playing" ] && echo "Same artist/album" >> $LOG && exit 0 # echo "Artist/album changed: $playing" >> $LOG #[ -f "/tmp/conkyCover.png" ] && rm "/tmp/conkyCover.png" -cp $HOME/.config/conky-mpd/nocover.png /tmp/conkyCover.png +cp "$HOME"/.config/conky-mpd/nocover.png /tmp/conkyCover.png # echo "NoCover" >> $LOG +filedir="$(dirname "$XDG_MUSIC_DIR/$(mpc --format %file% | head -n1)")" coverfile="$(find "$filedir" -maxdepth 1 -type f \( -iname 'cover.jpg' -o -iname 'cover.png' -o -iname 'folder.jpg' -o -iname 'folder.png' -o -iname '*.jpg' -o -iname '*.png' \) -print -quit)" #COVER="$CACHE/$ARTIST - $ALBUM.jpg" ## Is cover cached? @@ -60,6 +60,7 @@ coverfile="$(find "$filedir" -maxdepth 1 -type f \( -iname 'cover.jpg' -o -iname #convert /tmp/cover.png $HOME/.config/conky-mpd/case.png -composite /tmp/cover.png >> $LOG ## Resize for immediate use # convert /tmp/cover.png -resize 120 /tmp/conkyCover.png >> $LOG +echo "$coverfile" >/tmp/asd convert "$coverfile" -resize 100 /tmp/conkyCover.png # >> $LOG ## Set current artist echo "$playing" > $TMP |