Skip to content

Repository files navigation

pi-dashboard

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.

Dashboard Screenshot

Features

  • 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 /boot with bars
  • Clean exit on Ctrl+C or SIGTERM — screen clears on quit
  • Double-buffered rendering — full frame drawn in RAM, committed in one memcpy

Requirements

On the Pi:

sudo apt install libfreetype6-dev

Font: 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.

Configuration

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

# Build locally (requires freetype installed on dev machine)
make

# Build and run locally
make run

# Clean build artifacts
make clean

Requires 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.

Deployment

The deploy target syncs source + font from the dev machine to the Pi, then builds remotely:

make deploy

What it does:

  1. rsync (checksum-based) source files to pibeast:~/dashboard/
  2. Creates ~/.fonts/ttf/ on the Pi if missing
  3. Copies the font file from dev machine to Pi
  4. SSH in and runs make clean build on the Pi

To also install and enable as a systemd service (auto-starts on boot):

make install

The 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'

Makefile targets

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

Back Buffering

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

Changelog

[0.2.0] - 2026-03-19

  • Added disk usage for / and /boot with 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_length instead of hardcoded WIDTH
  • make deploy now syncs font from dev machine to Pi automatically
  • make deploy uses checksum-based rsync to handle Pi-side edits
  • make deploy always does a clean rebuild on the Pi

[0.1.0] - 2026-03-19

  • Initial framebuffer dashboard with FreeType rendering
  • CPU usage + temperature with color-coded bar
  • RAM usage with progress bar
  • IP address (refreshed every 10s)
  • config.h for centralized configuration
  • Makefile with build, run, clean, deploy, install targets
  • systemd service for autostart on boot

About

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.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages