Step 8: Putting it Together with BASH and Python
The first step to creating these scripts is to edit the autostart file in the LXDE directory. Edit this file with:
sudo nano /etc/xdg/lxsession/LXDE/autostart
Now add two lines to the end:
Save and exit, and your OS is configured to start pianobar at startup. It will also begin continuously polling for pushbuttons.
PYTHON AND BASH SCRIPTS:
The scripts used to control the LCD and buttons are hosted in a Github repository. They can be retrieved through the following:
git clone git://github.com/AyMac/Pandoras-Box.git
git pull origin
cp -r /home/pi/.config/pianobar/Pandoras-Box/scripts/ .
Now that the scripts have been retrieved, only one step remains to create a working system.
Final Step: Since one of the options is to randomly select a new station, the main script needs to know how many stations are on a user's Pandora account. (To figure this out, start Pianobar and press "s". This will list all the available stations). Now open the file /home/pi/.config/pianobar/scripts/ButtonPiper.sh and change the "n=" value to the number found above.
Your system should be complete! Please comment on this Instructable with any issues you have, and I will try to address them. The next step talks about making a case, but the system should be fully functional before this step.