Since lockdown started, I’ve found I often miss video meetings. It’s not intentional, I simply lose track of time. Though my phone is set to remind me of upcoming meetings ten minutes before they begin, I have a habit of trying to fill that time with something productive and before I know it, I have Eben on the phone, fifteen minutes after the meeting’s start, asking where I am.
Fixing the issue using code
Due to this, and because I was interested in playing with the Google API and learning a little more Python, I decided to write a simple application that will get your upcoming events from your Google Calendar and give you notifications as often as you want, visually on screen as well as through sound.
I call it NextEvent
Here’s the video tutorial to show you more:
And here’s the written tutorial too!
Installing NextEvent to your Raspberry Pi
To install NextEvent, open a terminal window (Ctrl-Alt-T) on Raspberry Pi and type:
sudo apt update
sudo apt upgrade
git clone https://github.com/ghollingworth/nextevent
This will get the files from my GitHub repository. Next you’ll need to install some dependencies, and I’ve created a script to make that easy:
The dependencies are
dateutil (a library for manipulating time and dates), the Google API client libraries, and the
gi-cairo library (which is for drawing the GUI).
Then fire up NextEvent:
The next thing you’ll see is NextEvent starting up, and then it’ll open Chromium. It is here that you will give Google permission to share your calendar with the application.
You’ll then need to log into your Google account and give NextEvent access to your calendar. Chromium will tell you when everything is fine and you can close the browser.
Now you can see your next five events along with the time left until each one. When the time gets down to five minutes, the application will turn red and ‘ding’ at you. It’ll ‘ding’ twice at one minute to go, and four times when your meeting is about to start!
In case you want to delve into the code, maybe to create a meeting room ‘now and next’ display, the
nextevent.py source contains the GUI and event processing part of NextEvent. You should be able to go here and change the number of lines, the colours, and the notification sounds.
How does it work?
If you’re the sort that likes to know HOW the code works, here’s a follow-up to the tutorial video where I explain exactly that!