blahsd / snwe

🚀 Extensible, customisable, menubar replacement for macOS/UNIX.
304 stars 9 forks source link

actually fix spotify.. #27

Closed koekeishiya closed 6 years ago

koekeishiya commented 6 years ago

So I added a second commit to my old PR before it was merged that actually ended up breaking it for some reason...

The commit basically unified it to return both artist and track in the same osascript call, and while it worked when ran from the terminal, something makes it not work when it is executed through execSync.

The output is just gone, the playback icon no longer shows and half the bar seems to not load properly. No error message is printed during startup.

I've split them into two separate osascript calls again, and now it works fine.

Running the following from a shell yields artist - song, but does not work inside snwe

# from terminal
osascript -e 'tell application "Spotify" to artist of current track & " - " & name of current track as string' 

# inside snwe with quote escaping
/usr/bin/osascript -e 'tell application \"Spotify\" to artist of current track & \" - \" & name of current track as string' 

This commit reverts the unification and splits it into two commands, which make it work. I don't have enough experience with node or javascript to actually debug this issue.

blahsd commented 6 years ago

Looks like it's still fucking up to me!

I'll try to help out tonight

blahsd commented 6 years ago

Ok I think it was giving me issues just because I don't have Spotify installed.