Spotify Next Button 2012/10/09

Well I told you all about the physical Facebook Like Button. The day after the ITisCool fair I was at home, working on another project, and frustrated about some of the songs that came on Spotify radio. (the spotify preview for linux wasn’t nearly as flawless as the current one)

One could go to the spotify window each time and hit next, but after a while the screen switching gets kind of annoying. I already installed spotify-notify.
That program does 4 things:

  1. make the control buttons of spotify integrate with the ubuntu sound menu
  2. make the media keys on your keyboard work
  3. make notification bubbles when a new song starts
  4. make spotify launch when spotify-notify launches

To me only the first three where important and I made it so that spotify-notify starts when I log in but without actually launching spotify. It just does nothing until I launch spotify myself.

So yes, I also had the option of changing the song by going to the ubuntu sound menu. But that also required 3 mouse clicks. And yes the mediakeys are an option as well, but hack, a giant button is just way cooler!

spotify-notify allows you to open multiple instances of it, nice because you can use the controls over terminal as well.

Modifying the python script that I wrote for the Facebook Button allowed me to, instead of changing the browser tab, change the song via spotify-notify.
I didn’t bother to change the code outputted by the arduino in the button. It still sends “like” whenever you press it (although next would have been better).
In the end all I had to do when Justin Bieber started playing was hitting the massive button dome and his song was gone..
You can find the code here:

import serialimport os

ser = serial.Serial(‘/dev/ttyACM0′, 9600)

while 1: msg = ser.readline() if “like” in msg: os.system(“/home/wouter/spotify-mediakeys-notifics/spotify-notify/spotify-notify.py -s -a next &”)

keep on hacking

 

woutervddn
TechProjectMasters