summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
authorJoe <rrbo@proton.me>2023-01-17 16:01:37 +0100
committerJoe <rrbo@proton.me>2023-01-17 16:01:37 +0100
commit2c728b96362eab06e07a61a305a5a0155f78258a (patch)
tree5c43a628115074332bce31bcb7b0ac30383c2b1b /.local
parentup (diff)
downloaddotfiles-bsd-2c728b96362eab06e07a61a305a5a0155f78258a.tar.gz
dotfiles-bsd-2c728b96362eab06e07a61a305a5a0155f78258a.tar.bz2
dotfiles-bsd-2c728b96362eab06e07a61a305a5a0155f78258a.tar.xz
dotfiles-bsd-2c728b96362eab06e07a61a305a5a0155f78258a.tar.zst
dotfiles-bsd-2c728b96362eab06e07a61a305a5a0155f78258a.zip
up
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/conky_cover.sh26
1 files changed, 13 insertions, 13 deletions
diff --git a/.local/bin/conky_cover.sh b/.local/bin/conky_cover.sh
index 571a240..ffdd403 100755
--- a/.local/bin/conky_cover.sh
+++ b/.local/bin/conky_cover.sh
@@ -9,11 +9,12 @@
## CONFIGURATION ##
# Folder for cached album art
# Don't use ~, as conky will treat it as a regular directory name
-CACHE="$HOME/.cache/covers"
+# CACHE="$HOME/.cache/covers"
# API Key for Last.fm
-APIKEY="b25b959554ed76058ac220b7b2e0a026"
+# APIKEY="b25b959554ed76058ac220b7b2e0a026"
# Log file, only for debugging purposes
LOG=/tmp/conky-mpd.log
+TMP=/tmp/conkympd.tmp
# Check for vital commands
# CMD="mpc curl convert"
@@ -22,20 +23,19 @@ LOG=/tmp/conky-mpd.log
# done
# [ ! -d "$CACHE" ] && mkdir -p "$CACHE"
-ARTIST="$(mpc --format %artist% | head -1)"
-ALBUM="$(mpc --format %album% | head -1)"
-FILEDIR="$(dirname "$XDG_MUSIC_DIR/$(mpc --format %file% | head -n1)")"
+playing="$(mpc --format '%artist% - %album%' | head -1)"
+filedir="$(dirname "$XDG_MUSIC_DIR/$(mpc --format %file% | head -n1)")"
-TMP=/tmp/conkympd.tmp
[ ! -f $TMP ] && touch $TMP
-[ "$(cat $TMP)" == "$ARTIST+$ALBUM" ] && echo "Same artist/album." >> $LOG && exit 0
-echo "Artist/album changed: $ALBUM by $ARTIST" >> $LOG
+[ "$(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
-echo "NoCover" >> $LOG
+# echo "NoCover" >> $LOG
-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)"
+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?
#if [ ! -f "$COVER" ]; then
@@ -50,7 +50,7 @@ coverfile="$(find "$FILEDIR" -maxdepth 1 -type f \( -iname 'cover.jpg' -o -iname
# echo "Downloaded to $COVER." >> $LOG
#fi
# Copy cache for processing
-echo "Copying $coverfile." >> $LOG
+# echo "Copying $coverfile." >> $LOG
# cp "$COVER" /tmp/cover.jpg
# Downscale to fit overlay
# convert /tmp/cover.jpg -resize 366 /tmp/cover.png >> $LOG
@@ -60,8 +60,8 @@ echo "Copying $coverfile." >> $LOG
#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
-convert "$coverfile" -resize 100 /tmp/conkyCover.png >> $LOG
+convert "$coverfile" -resize 100 /tmp/conkyCover.png # >> $LOG
## Set current artist
-echo "$ARTIST+$ALBUM" > $TMP
+echo "$playing" > $TMP
#rm /tmp/cover.jpg /tmp/cover.png