dotfiles/.config/Scripts/albumart.sh

26 lines
471 B
Bash
Executable File

#!/bin/bash
#put this file to ~/.ncmpcpp/
COVER=~/.cache/bum/current.jpg
function reset_background
{
printf "\e]20;;100x100+1000+1000\a"
}
{
#resize the image's width to 300px
#convert "$COVER" -resize 300x "$COVER"
if [[ -f "$COVER" ]] ; then
#scale down the cover to 30% of the original
sleep 3
printf "\e]20;${COVER};70x70+0+00:op=keep-aspect\a"
else
reset_background
fi
} &