display thingy
ambient smart dashboard widget
displayThingy | Personal Project
technologies: Python, Pygame, Spotipy, pytz, Nix Shell, Raspberry Pi
overview
displayThingy is an aesthetic, real-time smart dashboard designed for ambient desktop screens or wall-mounted displays (such as a Raspberry Pi). Built using Pygame, it integrates Spotify tracking, cyclical world timezone clocks, and real-time weather metrics in a dark-mode UI.
Interface dashboard layout displaying Spotify track progress, clock, and weather.
features
- real-time spotify player: Tracks song names, artist details, album art, and progress tracks. To keep API requests low and avoid rate limits, the player interpolates playback progress locally, only querying the Spotify Web API during track transitions or updates.
-
timezone clock cycles:
A cycling list of timezones (configured in
configs.json) displaying current times, date formats, and offset calculations relative to your designated home timezone. -
asynchronous weather fetches:
Queries the
wttr.inAPI in a background thread to prevent the dashboardβs rendering loops from stuttering or blocking during network latency. - ambient click-to-dim: Tapping or clicking the center of the display toggles a dim overlay, making it comfortable to use as a bedside clock or ambient display at night.
architecture
The project splits configurations, data collection widgets, and rendering views:
displayThingy/
βββ configs.json # Screen resolutions and view profiles
βββ main.py # App setup & primary Pygame drawing loop
βββ widgets/ # Data retrievers
β βββ world_clock/clock.py # Timezone cycling maths
β βββ weather/weather.py # Async wttr.in updates
β βββ spotify/spotify.py # Spotify API authentication & local tracking
βββ views/ # Drawing & layout managers
βββ base_view.py # Base layout definition
βββ spotify_clock_weather_view.py # Double-line layout subclass
deployment
Designed to auto-launch on startup on a Raspberry Pi running Raspberry Pi OS with the labwc compositor:
# inside ~/.config/labwc/autostart
lxterminal -e ~/Documents/displayThingy/run_display.sh &
The launch script loads the environment variables, activates the local Python virtual environment, and executes the Pygame application in fullscreen mode:
#!/bin/bash
# ~/Documents/displayThingy/run_display.sh
cd ~/Documents/displayThingy
source .dt_venv/bin/activate
python main.py --width 1024 --height 600 --fullscreen