From 7d1c6130be138628799c92f803b9d9183a54e637 Mon Sep 17 00:00:00 2001 From: glitchd Date: Wed, 26 Feb 2020 04:51:48 -0600 Subject: [PATCH] wrote script --- pianobarstart | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) mode change 100644 => 100755 pianobarstart diff --git a/pianobarstart b/pianobarstart old mode 100644 new mode 100755 index 583ded5..ad909b7 --- a/pianobarstart +++ b/pianobarstart @@ -1 +1,33 @@ -screen -S pianobar -d -m pianobar | node ~/Patiobar/index.js | chromium-browser http://192.168.1.186:3000 & +#!/bin/bash + +#create variable with path to patiobar folder +patiodir="/home/pi/Patiobar" + +# change directory to the contents of $patiobar variable +cd ${patiodir} + +# define screenPb function +screenPb(){ + screen -S pianobar -d -m pianobar +} + +# define runNode function +runNode(){ + node index.js +} + +#define openBrowser function +openBrowser(){ + chromium-browser http://192.168.1.186:3000 /dev/null & + +} + +#call all functions 1 by 1 +screenPb +runNode +openBrowser + +# Keeping for later +#screen -S pianobar -d -m pianobar | node ~/Patiobar/index.js | chromium-browser #http://192.168.1.186:3000 & + +#screen will not open after all is done, must be opened manually.