Skip to content

meshpunk/gui

Repository files navigation

MeshPunk - LVGL with Lua for T-Deck

This project demonstrates using LuaVGL on the LilyGo T-Deck device. LuaVGL is a Lua binding for LVGL that allows you to create GUIs with Lua scripts.

Features

  • Combines the power of LVGL with the simplicity of Lua scripting
  • Runs on the LilyGo T-Deck
  • Demonstrates touch and display capabilities
  • Uses PlatformIO for easy building
  • Loads Lua scripts from the filesystem
  • Integrates MeshCore networking

Project Structure

  • /src - Main C++ code
    • main.cpp - Main application code
  • /data - Data files that get uploaded to the device filesystem
    • /lua - Lua scripts
      • /apps - Lua apps

Requirements

  • PlatformIO
  • T-Deck device
  • Git (for submodules)

Building and Development

  1. softwareupdate --install-rosetta
  2. Clone this repository
  3. Initialize the submodules:
    git submodule update --init --recursive
    
  4. Open in PlatformIO
  5. Edit Lua scripts in the /data/lua directory
  6. Build and upload to your T-Deck device:
    pio run --target upload
    
    This will upload only the firmware, not the filesystem data.
  7. To upload the filesystem data (when changing lua scripts)
    pio run --target uploadfs
    

VSCode hints

You must close the serial monitor before uploadfs or it wont work.

Usage

The example loads the launcher.lua script from the filesystem and displays a simple launcher UI. You can edit the Lua scripts in your IDE with proper syntax highlighting and then upload just the filesystem to quickly iterate on your UI design.

Developing Lua Scripts

  1. Edit the Lua scripts in /data/lua
  2. Upload the filesystem with pio run --target uploadfs
  3. The device will automatically load the updated scripts

Adding Additional Scripts

You can create additional Lua scripts in the /data/lua directory. Scripts can be loaded from other scripts using require:

local utils = require('utils')

You should add your apps to apps.toml to have them appear in the launcher.

PRs

Pull requests are welcome! Please keep in mind the following rules:

  • should be minimal (only touch required files, minimal changes)
  • respect the current code style and indentation
  • be the most obvious code that will run performantly
  • keep your code idiomatic unless theres a good reason not to

The goal is to make this project easy for new developers to pick up and contribute to.

License

MIT

Credits

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •