Simplified clock/dashboard aimed at raspberry pi
- Install Nodejs and npm
- Clone repo
- Run
npm start - Customize widgets with .env
- Install surf (
sudo apt install surf) - Set pidash to update and start on boot
cp pidash.service /etc/systemd/system/pidash.servicesudo systemctl daemon-reloadsudo systemctl enable pidash
- Restart Pi
The development version of pidash uses the defaults environment variables found .env
- Run
npm dev - Access
localhost:3000to access pidash
varconfig={backgroundImages: ["/img/bunnies.jpg",// https://i.imgur.com/mE1MUpd.jpeg"https://i.imgur.com/nR8jJEM.jpeg","https://live.staticflickr.com/5443/9369949185_0846c27d6c_b.jpg","https://live.staticflickr.com/3804/11623216156_9e9f5eaa4a_c.jpg",],redditUrl: "https://www.reddit.com/r/EarthPorn/hot.json",widgets: [{widget: "GRTbus",data: {stop: "5008"},},{widget: "Status",data: {url: "https://example.com/status.txt"},},{widget: "Weather",data: {appid: "xxxxxxxxx",city: "Waterloo"},},],};The config file allows you to select widgets and set the background images. The widget tag refers to the name of the function in the file and the data is passed to the widget constructor. We can include multiple instances of the same widget as well.
Widgets are added via a single js file in /widgets in the template below:
/*{Widget Description}@author {author}@version 1.0@data {id} - {description}*/widgetDirectory.{WidgetID}=function(data){// 10 second loop// we've decided not to use this loop, we still have to define itthis.quickloop=null;// 10 min loopthis.loop=function(callback){$.getJSON("https://exampleurl.com?a="+data.{id},function(value){//icon class from owf or font awesome fontsvaricon="owf owf-"+value.icon+"-d";//the text (usually a single or double digit number)vartext=value.text;// callback to pass the information to the displaycallback(icon,text);});}}Unfortunately, we need to include the js file in the top of index.html right now. (see issue #1)
Feel free to submit a PR request with additions and/or bug fixes!
- david329
- dotjersh
- benkeun