Bug fixes.

This commit is contained in:
deepjyoti30 2019-02-19 18:28:32 +05:30
parent 8dd8dbbda3
commit 8489545fbd
1 changed files with 14 additions and 20 deletions

26
kunst
View File

@ -112,6 +112,12 @@ update_cover() {
main() {
# Flag to run some commands only once in the loop
FIRST_RUN=true
while true; do
update_cover
if [ $ARTLESS == true ];then
@ -127,29 +133,17 @@ main() {
echo "kunst: swapped album art to $(mpc current)"
echo "------------------------------------------"
if [ $FIRST_RUN == true ]; then
FIRST_RUN=false
# display the album art using sxiv
sxiv -g $DIMENSION -b $COVER -N "Kunst" &
fi
while true; do
# waiting for an event from mpd; play/pause/next/previous
# this is lets kunst use less CPU :)
mpc idle &> /dev/null
echo "kunst: received event from mpd"
update_cover
if [ $ARTLESS == true ];then
# change the path to COVER because the music note
# image is a png not jpg
COVER=/tmp/kunst.png
# decode the base64 encoded image and save it
# to /tmp/kunst.png
echo "$MUSIC_NOTE" | base64 --decode > $COVER
fi
echo "kunst: swapped album art to $(mpc current)"
echo "------------------------------------------"
done
}