modulo
                                
                                
                                
                                    modulo copied to clipboard
                            
                            
                            
                        Basic Cross-platform GUI Toolkit for Any Language
modulo
A (very) basic Cross-platform GUI Toolkit for Any Language
Modulo is a simple, distributable binary that can be used to generate a variety of native GUI dialogs with ease:
| macOS | Linux | Windows | 
|---|---|---|
![]()  | 
![]()  | 
![]()  | 
Table of Contents
- Installation
- Windows
 - macOS
 - Linux
 
 - Getting Started
 - Technology
 
Installation
modulo is still in its early days, so some of the details are work in progress.
Windows
espanso users
If you use modulo as part of espanso, it's shipped by default with it since version 0.7.0.
Prebuilt release
For Windows x64 systems, you can find the prebuilt modulo-win.exe in the Releases page.
While you can simply download it in your favourite location, if you use modulo as part of espanso you should:
- Rename the executable from 
modulo-win.exetomodulo.exe - Move it to a persistent location, such as 
C:\modulo\modulo.exe - Add that location (
C:\modulo) to the PATH environment variable. 
modulo also requires Visual C++ Redistributable 2019 to run.
Compile from source
To compile modulo on Windows, you need a recend Rust compiler, the MSVC C++ compiler and the LLVM compiler.
TODO
macOS
espanso users
If you use modulo as part of espanso and used Homebrew to install it, modulo is automatically included since version 0.7.0.
Prebuilt release
For x64 macOS systems, you can find the prebuilt modulo-mac in the Releases page.
While you can simply download it in your favourite location, if you use modulo as part of espanso you should:
- Rename the executable from 
modulo-mactomodulo - Place it in 
/usr/local/bin 
Compile from source
Compiling from source on macOS requires a few steps:
- Download the wxWidgets source archive
 - Extract the content of the archive in a known directory, such as 
$USER/wxWidgets. - Open a terminal, cd into the wxWidgets directory and type the follwing commands:
 
mkdir build-cocoa
cd build-cocoa
../configure --disable-shared --enable-macosx_arch=x86_64
make -j6
- 
Install LLVM using Homebrew with:
brew install llvm - 
Now open the
moduloproject directory in the Terminal and compile with:WXMAC=$USER/wxWidgets cargo build --release - 
You will find the compiled binary in the
target/releasedirectory. 
Linux
AppImage
On Linux the easiest way to use modulo is the offical AppImage, that you can find in the Releases page.
Compile from source
Compiling modulo is not too difficult, but requires many tools so it's highly suggested to use the AppImage instead. If you still want to compile it:
- 
Install the wxWidgets development packages for you platform, the Clang compiler and the Rust compiler. On Ubuntu/Debian, they can be installed with:
sudo apt install clang libwxgtk3.0-0v5 libwxgtk3.0-dev build-essential. - 
In the project directory run:
cargo build --release. - 
You will find the compiled binary in the
target/releasedirectory. 
Getting started
Creating a Form
There are a variety of built-in dialogs that can be customized by feeding modulo with YAML (or JSON) descriptors:
- Create a 
form.ymlfile with the following content: 
layout: |
  Hey {{name}},
  This form is built with modulo!
- Invoke 
modulowith the command: 
modulo form -i form.yml
- The dialog will appear:
 

- After clicking on 
Submit(or pressing CTRL+Enter), modulo will return to theSTDOUTthe values as JSON: 
{"name":"John"}
This was a very simple example to get you started, but its only the tip of the iceberg!
Technology
Modulo is written in Rust and uses the wxWidgets GUI toolkit under the hoods. This allows modulo to use platform-specific controls that feel, look and behave much better than other solutions based on emulation (such as web-based technologies as Electron), with the additional benefit of a very small final size.
More info coming soon...


