Skip to content

HTML calendar generator intended for screenshotting output for eInk displays

Notifications You must be signed in to change notification settings

emceeaich/7-calendar-cafe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Seven Calendar Cafe

screenshot

This is a static HTML project which uses JavaScript to generate a calendar for the current month (by default) according to the clock on the browser displaying it.

The generated HTML is intended for display on an eInk display, via a screen capture by running a browser on the command line, or even a screenshot service.

The CSS on this project is optimized for display on Pimoroni's seven-color eInk display for the Raspberry Pi.

Motivation

Leverage a browser's HTML and CSS engine to lay out the calendar for us.

The project was inspired by a three-line layout using CSS Grid to lay out the calendar.

Adding a custom background, different typography, or even date-sensitive styling is a straightforward extension of the project.

Usage

This project accepts the optional query string parameter month which can take on the value previous and next to display the calendar for the previous and next months.

The current date is highlighted when the calendar is displayed.

Using with eInk Display

I am able to run this on a stock RaspberryPi Zero W. Install the fully RaspberryPi OS with desktop. If you use the RaspberryPi imager you can specify a user to create as well as pre-fill the WiFi credentials. Be sure to enable ssh login.

Once the eInk display is attached to the Pi and the necessary drivers and libraries are installed, you can fetch a screenshot with the current calendar using:

chromium-browser --headless --screenshot="~/screenshot.png" --window-size=600,448 "https://7-calendar-cafe.glitch.me"

or

firefox --headless --screenshot --window-size=600,448 'https://7-calendar-cafe.glitch.me/'

I have not been able to run Firefox as a headless browser from the command line on Pi Zero W.

You need to be specific about the --window-size parameter for the dimensions of your eInk display's screen.

You'll need a script (in this case Python) which works with the Pimoroni eInk display's libraries:

#!/usr/bin/env python3

import sys

from PIL import Image
from inky.inky_uc8159 import Inky

inky = Inky()
saturation = 0.5

image = Image.open("/home/pi/screenshot.png")

inky.set_image(image, saturation=saturation)
inky.show()

And a bash script can run the process daily once you set up a crontab entry for it.

cd $HOME
chromium-browser --headless --screenshot="~/screenshot.png" --window-size=600,448 "https://7-calendar-cafe.glitch.me" 
./calendar.py

Since the idea behind eInk is to only update when you need to, using a whole Raspberry Pi (even a Pi Zero W) feels like one's over specified the hardware for the project.

The 7-color Pimoroni display has buttons you can program, and using them will be the next version of this project.

Show off your mods with the hashtag #SevenCalendarCafe on Twitter and the Fediverse.

The project's title is a nod to both the Pimoroni Inky Impression and The Cocteau Twins.

About

HTML calendar generator intended for screenshotting output for eInk displays

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages