Skip to content

Instantly share code, notes, and snippets.

@adammhaile
Last active August 25, 2017 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adammhaile/0bf22cc050a9a003cb4ea03f4421bcf7 to your computer and use it in GitHub Desktop.
Save adammhaile/0bf22cc050a9a003cb4ea03f4421bcf7 to your computer and use it in GitHub Desktop.
#! /bin/bash
# Clone needed repos
pushd /home/pi
git clone https://github.com/adammhaile/AnimatedGifs.git
git clone https://github.com/adammhaile/DisplayGraphics.git
git clone https://github.com/ManiacalLabs/HT1632_Serial.git
git clone https://github.com/adammhaile/BiblioPixelProjects.git
git clone https://github.com/ManiacalLabs/BiblioPixelAnimations.git
pushd ./BiblioPixelAnimations
python3 setup.py develop
popd
# Install requirements
pip3 install opencv-python numpy noise pillow
pip3 install bibliopixel
# Setup Service
cat >/lib/systemd/system/bibliopixel.service <<EOL
[Unit]
Description=BiblioPixel Remote UI
After=multi-user.target
[Service]
Type=idle
ExecStart=/usr/local/bin/bibliopixel run /home/pi/config.json
ExecStop=/usr/bin/sudo /usr/local/bin/pkill bibliopixel
[Install]
WantedBy=multi-user.target
EOL
CONFIG_BASE="/home/pi/BiblioPixelProjects/SparkCon2017"
echo "Choose one of the following:"
ls -1 "${CONFIG_BASE}"
read choice
CONFIG_FILE="${CONFIG_BASE}/${choice}"
echo "${CONFIG_FILE}"
if [[ ! -f "${CONFIG_FILE}" ]]; then
echo "${CONFIG_FILE} is not a valid choice."
echo "symlink the desired file to /home/pi/config.json"
echo "Then run: systemctl enable bibliopixel; systemctl start bibliopixel"
fi
ln -sf "${CONFIG_FILE}" "/home/pi/config.json"
systemctl enable bibliopixel.service
systemctl start bibliopixel.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment