32

Spotify now Playing

Posted in Music by alberto1991lucca 1219 days ago

All credits goes to thcousins, I just modified his applescript a little bit. The code:

DATA=$(osascript -e 'tell application "System Events"
    set myList to (name of every process)
end tell
if myList contains "Spotify" then
    tell application "Spotify"
    if player state is stopped then
    set output to "Stopped"
    else
    set trackname to name of current track
    set artistname to artist of current track
    set albumname to album of current track
    if player state is playing then
    set output to trackname & " | " & artistname & " | " & albumname & "new_line" & "Playing on Spotify | "
    else if player state is paused then
    set output to trackname & " | " & artistname & " | " & albumname & "new_line" & "Paused | "
    end if
    end if
    end tell
else
    set output to "Spotify is not running"
end if')
echo $DATA | awk -F new_line '{print $1}'
echo $DATA | awk -F new_line '{print $2}'

Screenshot:

screenshot

p.s. I hope you know what spotify is :)

Geeklet files to download

Comments

User Avatar
rcox1963 1188 days ago
Can the album cover art also be displayed?

Like this guy did...

Spotify info on the Desktop via NerdTool

http://www.leancrew.com/all-this/2011/07/spotify-info-on-the-desktop-via-nerdtool/
User Avatar
alberto1991lucca 1184 days ago
Yes, I think yes.

But it's a too long work for me, i can't help you.
User Avatar
heythereheather01 1130 days ago
Why doesn't the stuff update when the song changes? I keep having to go into GeekTool and hit refresh. That gets annoying after the first few times. Can you help?
User Avatar
Raldor46 1101 days ago
im not using this geeklet but you should set a refresh rate of 1 second, so the second the song changes, the geeklet refreshes

Log in to comment or register here.