extra | ||
static | ||
.dockerignore | ||
.gitignore | ||
config.go | ||
docker-compose.yml | ||
Dockerfile | ||
go.mod | ||
go.sum | ||
main.go | ||
nextrip.go | ||
readme.md | ||
screenshot.png | ||
style.scss |
---------------------------------------------------
/` '\
\ __ __ /
.-----.--------.-----|__| |--.--.--.-----.
| _ | | | | _ | | |__ --|
===|_____|__|__|__|__|__|__|_____|_____|_____|===
=====================================================
lil go webserver that shows departure times for Metro Transit stops
usage
- download this repo.
- edit
config.go
with your desired values. (see configuration) - build it with
go build
. - run the
omnibus
binary. you can view the page at http://localhost:8080.
ok but why?
i have this showing on a wall-mounted display inside layer zero that turns on while the cat signal is on. when you are planning to leave, you can glance to see this information while you wait for your bus or train inside :3
what's it look like?
features
- highly configurable
- switches between light and dark theme depending on the sun's position
- designed for a SBC that can run a web browser
- statically linked binary contains (almost, see extras) everything it needs to run and functions as a webserver.
configuration
the configuration data lives in config.go
and is compiled into the binary. the first few variables should be pretty self-explanatory; feel free to open an issue if they aren't.
the query
struct is where it gets a bit complicated. it is essentially there to coax data from the General Transit Feed Specification into the way it is displayed for humans. because there may be multiple station numbers per location that someone might call "a stop" (on either side of the road, at intermodal transfer points, or even one for each route, for example), you can combine them into Group
s under a shared name.
you can put as many Station
s as you'd like into a Group
. each Station
results in a query to the NexTrip API, which you can filter by Route
, showing the soonest from each if found.
extras
there are some extra not-totally-necessary files in extra/
to help you use it.
i3/config
- barebones configuration for i3 window manager to start a web browser and manage the display's power.scripts/catsign_listener.sh
- the cat signal is our occupancy indicator at layer zero. this script checks every minute whether it is turned on, and puts the display to sleep if it's off.scripts/dev.sh
- run this in the background when you are developing omnibus to automatically compile and run when changes are made.scripts/update.sh
- this will pull the latest code (assuming you cloned the git repo), compile, and install it to/usr/sbin/omnibus
. you could run a cronjob to check for changes every hour, for example.omnibus.service
- place this systemd unit file in/etc/systemd/system/
and you can have it start on system boot withsudo systemctl enable --now omnibus
.