diff options
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 |