A minimal framebuffer dashboard for Raspberry Pi 3, built with C and FreeType. Renders directly to /dev/fb1 (or any framebuffer device) with no X11 or GUI toolkit. Double-buffered to avoid tearing. Low resource usage by design.
- Clock — time and date
- CPU usage % with color-coded bar (green → red above 70%)
- CPU temperature
- RAM used / total with bar (yellow → red above 80%)
- IP address (refreshed every 10s)
- Disk usage for
/and/bootwith bars - Clean exit on
Ctrl+CorSIGTERM— screen clears on quit - Double-buffered rendering — full frame drawn in RAM, committed in one
memcpy
On the Pi:
sudo apt install libfreetype6-devFont: a TTF font must exist at the path set in FONT_PATH (see Configuration).
The deploy target copies the font from the dev machine to the Pi automatically.
Edit config.h before building:
| Define | Current value | Description |
|---|---|---|
FB_DEV |
/dev/fb1 |
Framebuffer device |
FONT_PATH |
/home/a/.fonts/ttf/JetBrainsMonoNerdFont-Medium.ttf |
Path to TTF font on target machine |
WIDTH / HEIGHT |
360 / 240 |
Screen resolution |
REFRESH_US |
1000000 |
Refresh interval (microseconds) |
IP_REFRESH_TICKS |
10 |
Ticks between IP refreshes |
HOSTNAME_LABEL |
pibeast |
Label shown in footer |
# Build locally (requires freetype installed on dev machine)
make
# Build and run locally
make run
# Clean build artifacts
make cleanRequires pkg-config and libfreetype6-dev on the build machine.
LSP (clangd) support: compile_flags.txt is included in the repo — no extra setup needed in Neovim.
The deploy target syncs source + font from the dev machine to the Pi, then builds remotely:
make deployWhat it does:
rsync(checksum-based) source files topibeast:~/dashboard/- Creates
~/.fonts/ttf/on the Pi if missing - Copies the font file from dev machine to Pi
- SSH in and runs
make clean buildon the Pi
To also install and enable as a systemd service (auto-starts on boot):
make installThe service file (dashboard.service) assumes:
- Binary at
/home/pi/dashboard/dist/dashboard - Running as user
pi
Adjust dashboard.service if your Pi username differs, then re-run make install.
To stop the dashboard:
# In the terminal running it
Ctrl+C
# Or from another session
pkill dashboard
# or
ssh pibeast 'pkill dashboard'| Target | Description |
|---|---|
build |
Compile natively |
run |
Build and run |
clean |
Remove dist/ |
deploy |
Rsync source + font to Pi, clean build remotely |
install |
Deploy + install/enable systemd service on Pi |
The dashboard uses double buffering to eliminate screen tearing. All drawing happens in a RAM buffer (backbuf), then the completed frame is committed to the framebuffer in one memcpy.
For a detailed explanation: https://claude.ai/chat/44e774a4-6d1a-41b2-b1ea-110fe1a8f5e4
- Added disk usage for
/and/bootwith color-coded bars - Double-buffered rendering — eliminates top-to-bottom tearing
- Clean exit on
SIGINT/SIGTERM— clears screen before quit - Error checking on all init calls (framebuffer open, mmap, FreeType)
- Fixed pixel stride to use actual
finfo.line_lengthinstead of hardcodedWIDTH make deploynow syncs font from dev machine to Pi automaticallymake deployuses checksum-based rsync to handle Pi-side editsmake deployalways does a clean rebuild on the Pi
- Initial framebuffer dashboard with FreeType rendering
- CPU usage + temperature with color-coded bar
- RAM usage with progress bar
- IP address (refreshed every 10s)
config.hfor centralized configurationMakefilewithbuild,run,clean,deploy,installtargets- systemd service for autostart on boot
