Coder Social home page Coder Social logo

tempus's Introduction

tempus

GitHub Actions Release License

A clock replacement for the office of ACM@UIC.

Features

Time

Time and date for the client's timezone.

Transit

Upcoming arrivals for CTA Bus and Train stops specified by the user.

Weather

Weather for specified location by the user from DarkSky's Weather API.

Events

Upcoming events for the specifed calendar ids from Google Calendar API.

SlackBot

Interactions using Slack's Real Time Messaging API. The app can interpret mentions and direct messages.

Configuration

Feature Configuration Name
Time
Transit ctabusapikey, ctabusstops, ctatrainapikey, ctatrainstations
Weather darkskyapikey, latlong
Events googleapikey, googlecalendarids
SlackBot slackbottoken
GitHub githubrepo

Docker Container Deployment

The app is packaged into a tiny (based on nginx) and easy to deploy docker container: bmiddha/tempus.

docker run -d --restart=always -p 8080:80 bmiddha/tempus

Deploying a Raspberry Pi as a Kiosk

Using pi-kiosk.sh

Usage: sudo bash pi-kiosk.sh <WEBSITE> <DISPLAY ORIENTATION: normal|left|right|inverted>

Example:

sudo bash pi-kiosk.sh http://localhost:8080 normal

Manual

These instructions should apply to I used a Raspberry Pi 4 Model B but should work for all Pis.

Enable ssh and set password for user pi as needed.

Disable overscan

sudo sed -i '1s/^/disable_overscan=1\n/' /boot/config.txt

Configure autologon

sudo mkdir -pv /etc/systemd/system/[email protected]
sudo cat << EOF >> /etc/systemd/system/[email protected]/autologin.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin pi --noclear %I $TERM
EOF
sudo cat << EOF >> /etc/systemd/system/[email protected]/noclear.conf
[Service]
TTYVTDisallocate=no
EOF

Configure timezone, locale, and keyboard layout.

cat <<EOF > /etc/default/keyboard
XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"
EOF
sudo timedatectl set-ntp true
sudo timedatectl set-timezone America/Chicago
sudo cp /etc/locale.gen /etc/locale.gen.bak
echo 'en_US.UTF-8 UTF-8' | sudo tee /etc/locale.gen
sudo locale-gen en_US.UTF-8
sudo update-locale en_US.UTF-8

Run system, and firmware updates.

sudo apt update && sudo apt upgrade -y
sudo SKIP_WARNING=1 rpi-update

Install X11 Server and, Chromium.

sudo apt install --no-install-recommends -y vim chromium-browser xserver-xorg x11-xserver-utils xinit openbox

Configure openbox to start chromium-browser. Replace WEBSITE varibale as needed.

WEBSITE='http://localhost:8080' cat << EOF >> /etc/xdg/openbox/autostart
# Disable any form of screen saver / screen blanking / power management
xset s off
xset s noblank
xset -dpms

# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp

# Start Chromium in kiosk mode
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences
xrandr --output HDMI-1 --rotate left
chromium-browser --disable-infobars --kiosk $WEBSITE
EOF

Start openbox on boot

echo '[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor' | sudo tee -a /home/pi/.profile

tempus's People

Contributors

bmiddha avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.