Last active
April 29, 2021 04:51
-
-
Save red-noise/9789642 to your computer and use it in GitHub Desktop.
Spotify script for Conky
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This is ho you should edit your conkyrc file in order to get the spotify player. | |
#################### | |
# - MEDIA PLAYER - # | |
#################### | |
${if_running spotify}${voffset -2}${font Liberation Sans:style=Bold:size=8} | |
${voffset -10}${goto 73}Title: | |
${goto 73}${color2}${exec ~/.conkycolors/spotify/spotify_info_title}${color} | |
${goto 73}Artist: | |
${goto 73}${color2}${exec ~/.conkycolors/spotify/spotify_info_artist}${color} | |
${goto 73}Album: | |
${goto 73}${color2}${exec ~/.conkycolors/spotify/spotify_info_album}${color} | |
${voffset -20} | |
${exec ~/.conkycolors/spotify/spotify_album_cover} | |
${image ~/.conkycolors/spotify/last_album_pic.png -p 0,180 -s 60x60} | |
${else}${voffset -5}${color0}${font ConkyColors:size=16}G${font}${color}${voffset -10}${goto 32}Spotify: ${color2}off${color}${voffset 7} | |
${endif} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Written by Demetrio Ferro <[email protected]> <https://twitter.com/DemetrioFerro> | |
# Distributed under license GPLv3+ GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY. YOU USE AT YOUR OWN RISK. THE AUTHOR | |
# WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY | |
# OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE. | |
# See the GNU General Public License for more details. | |
first_cover="" | |
while : | |
do | |
new_cover=$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 "artUrl"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$) | |
if [ "$new_cover" != "$first_cover" ] | |
then | |
first_cover="$new_cover" | |
wget -O ~/.conkycolors/spotify/last_album_pic.png $new_cover | |
fi | |
sleep 1 | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Written by Demetrio Ferro <[email protected]> <https://twitter.com/DemetrioFerro> | |
# Distributed under license GPLv3+ GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY. YOU USE AT YOUR OWN RISK. THE AUTHOR | |
# WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY | |
# OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE. | |
# See the GNU General Public License for more details. | |
first_album="" | |
while : | |
do | |
new_album=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 "album"|egrep -v "album"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$` | |
if [ "$new_album" != "$first_album" ] | |
then | |
first_album="$new_album" | |
echo "$new_album" | |
fi | |
sleep 1 | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Written by Demetrio Ferro <[email protected]> <https://twitter.com/DemetrioFerro> | |
# Distributed under license GPLv3+ GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY. YOU USE AT YOUR OWN RISK. THE AUTHOR | |
# WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY | |
# OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE. | |
# See the GNU General Public License for more details. | |
first_artist="" | |
while : | |
do | |
new_artist=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "artist"|egrep -v "artist"|egrep -v "array"|cut -b 27-|cut -d '"' -f 1|egrep -v ^$` | |
if [ "$new_artist" != "$first_artist" ] | |
then | |
first_artist="$new_artist" | |
echo "$new_artist" | |
fi | |
sleep 1 | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Written by Demetrio Ferro <[email protected]> <https://twitter.com/DemetrioFerro> | |
# Distributed under license GPLv3+ GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY. YOU USE AT YOUR OWN RISK. THE AUTHOR | |
# WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY | |
# OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE. | |
# See the GNU General Public License for more details. | |
first_title="" | |
while : | |
do | |
new_title=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 "title"|egrep -v "title"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$` | |
if [ "$new_title" != "$first_title" ] | |
then | |
first_title="$new_title" | |
echo "$new_title" | |
fi | |
sleep 1 | |
done |
not workin on my ubuntu 14.04 lts
Anyone tested on ubuntu 15?
Works for me with minor modifications (by deleting all the while loops). Thanks for sharing!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@erikdubois I think you could try changing the line:
${image ~/.conkycolors/spotify/last_album_pic.png -p 0,180 -s 60x60}
where you try adjusting 60x60