A minimal native GUI application for Raspberry Pi built with Rust, GTK4, and libadwaita.
- Beautiful native UI with libadwaita styling
- Tiny memory footprint: ~30MB RAM (vs 500MB+ for Electron/browser-based apps)
- Small binary size: ~473KB
- Fast startup time
- Cross-platform: runs on Mac, Linux, and Raspberry Pi
- Rust: Systems programming language with safety and performance
- GTK4: Modern, mature UI toolkit
- libadwaita: Beautiful adaptive widgets following GNOME design guidelines
.
├── Cargo.toml # Rust dependencies and project metadata
├── Cargo.lock # Locked dependency versions
├── src/
│ └── main.rs # Main application code
├── target/ # Build output (generated)
├── README.md # This file
├── DEPLOY.md # Deployment instructions for Raspberry Pi
└── build-for-pi.sh # Helper script for Pi deployment
- Install Homebrew (if not already installed):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"- Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"- Install GTK4 and dependencies:
brew install gtk4 libadwaita pkgconfNo compilation needed! Download pre-built binaries from GitHub Actions:
# Option 1: Use the download script (easiest)
curl -O https://raw.githubusercontent.com/YOUR_USERNAME/omma-linux/master/download-latest.sh
chmod +x download-latest.sh
./download-latest.sh
# Option 2: Manual download from GitHub releases
# Visit: https://github.com/YOUR_USERNAME/omma-linux/releases/latest
# Download the appropriate binary for your PiManual Raspberry Pi build: See DEPLOY.md for detailed compilation instructions.
cargo buildThe binary will be at: ./target/debug/hello-gtk-pi
cargo build --releaseThe binary will be at: ./target/release/hello-gtk-pi
Release builds are recommended for deployment - they're optimized and much smaller (~473KB vs ~2MB for debug).
This project uses local Docker builds to create ARM64 binaries for Raspberry Pi. This means you never need to compile on your Pi - just download the pre-built binary from GitHub releases!
Compiling Rust on a 1GB RAM Raspberry Pi is painful or impossible. Instead, we build ARM binaries locally on Mac using:
- Docker + Fedora - Proper GTK4 support out of the box
- Native ARM64 emulation - Apple Silicon Macs can run ARM64 natively
- Build time: ~27 seconds on M4 Pro
- Binary size: ~450KB
Run the automated build script:
./build-and-release-arm64.shThis will:
- Build ARM64 binary using Fedora Docker image
- Create a git tag
- Push to GitHub
- Create a GitHub release with the binary attached
Download and install from the latest release:
# Install GTK4 dependencies (one-time)
sudo apt-get update
sudo apt-get install -y libgtk-4-1 libadwaita-1-0
# Download the binary (check releases for latest version)
wget https://github.com/notabC/omma-linux/releases/download/v1.0.1/omma-aarch64-unknown-linux-gnu
# Make it executable
chmod +x omma-aarch64-unknown-linux-gnu
# Move to system path
sudo mv omma-aarch64-unknown-linux-gnu /usr/local/bin/omma
# Run the app
omma- Docker Desktop - For building ARM binaries
- GitHub CLI (
gh) - For creating releases - Recommended: Apple Silicon Mac for fast native ARM64 builds
After building, run:
# Development build
./target/debug/hello-gtk-pi
# Or release build
./target/release/hello-gtk-piOr build and run in one command:
# Development
cargo run
# Release (optimized)
cargo run --releaseAfter transferring and building (see DEPLOY.md):
./target/release/hello-gtk-piIf you just cloned this repo and want to see it running:
# 1. Install dependencies (one-time setup)
brew install gtk4 libadwaita pkgconf
# 2. Build and run
cargo run --releaseThe app window should appear with a "Hello World" message!
- Edit the code: Modify
src/main.rs - Test your changes: Run
cargo runto see changes immediately - Build for deployment: Run
cargo build --releasewhen ready to deploy
cargo check # Quick compile check (no binary)
cargo build # Build debug version
cargo build --release # Build optimized version
cargo run # Build and run (debug)
cargo run --release # Build and run (release)
cargo clean # Remove build artifactsThe current app is a minimal "Hello World". Here's how to add more functionality:
let button = gtk4::Button::with_label("Click Me");
button.connect_clicked(|_| {
println!("Button clicked!");
});
content_box.append(&button);let navigation_view = adw::NavigationView::new();
let page = adw::NavigationPage::builder()
.title("My Page")
.child(&content)
.build();
navigation_view.push(&page);let list_box = gtk4::ListBox::new();
list_box.append(>k4::Label::new(Some("Item 1")));
list_box.append(>k4::Label::new(Some("Item 2")));
content_box.append(&list_box);use std::time::Duration;
use glib::timeout_add_local;
// Update label every second
let label = gtk4::Label::new(Some("Loading..."));
let label_clone = label.clone();
timeout_add_local(Duration::from_secs(1), move || {
// Read your sensor here
label_clone.set_text("Sensor value: 42");
glib::ControlFlow::Continue
});Rust isn't installed or not in PATH. Install with:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"Install system dependencies:
# Mac
brew install gtk4 libadwaita pkgconf
# Raspberry Pi / Debian / Ubuntu
sudo apt install libgtk-4-dev libadwaita-1-dev build-essentialMake sure you're on a system with a graphical display (not SSH without X11 forwarding).
- Debug build: ~2MB
- Release build: ~473KB
- With strip: Can reduce further with
strip target/release/hello-gtk-pi
- GTK4-rs Documentation
- libadwaita-rs Documentation
- GNOME Human Interface Guidelines
- Rust Book
- Cargo Book
- Native Performance: Direct system calls, no browser overhead
- Low Resource Usage: Perfect for Raspberry Pi's limited resources
- Beautiful UI: libadwaita provides modern, polished widgets
- Type Safety: Rust prevents many common bugs at compile time
- Active Ecosystem: GTK4 and Rust both have great communities
- Single Binary: Easy deployment - just copy one file