Originally created as a simple calculator to teach kids how to program. It was simple. It was pure. It added 2 and 2 and got 4.
But then I came along. I saw a perfectly functional teaching tool and thought, "You know what this needs? Unnecessary complexity and a bad attitude." So I forked it, injected it with Rust, and stripped it of its innocence.
- Rust Backend: Powered by
neocalc-corevia UniFFI for high performance and safety. - Fraction Support: Toggle between precise fractional (e.g.,
1/2) and decimal (e.g.,0.5) outputs in Settings. - 4 Calculator Modes: Standard, Scientific, Programming, and Financial.
- Responsive Layout: Optimized for desktop resizing.
- Theming Engine: Import your own
.cssthemes (GTK-compatible). - Dark Mode: By default, because we respect your eyes.
You can install downloading the flatpak from the release page and running:
flatpak install ./neocalc.flatpakTo receive automatic updates, add the repository:
flatpak remote-add --user --if-not-exists neocalc https://niltonperimneto.github.io/neocalc/repo
flatpak install neocalc com.niltonperimneto.neocalcIf you really want to verify that mass times acceleration equals force (or merely a headache):
# Don't ask me why ABI3 is involved.
PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 cargo run --manifest-path desktop/Cargo.tomlNeoCalc supports custom themes defined in simple .css files. These themes are compatible with the original GTK version of the app.
- Create a
.cssfile (e.g.,my-cool-theme.css). - Open NeoCalc.
- Go to Settings or Theme Manager.
- Select "Import Theme" and choose your
.cssfile.
The theme parser looks for specific @define-color lines.
Format: @define-color KEY #HEXCODE;
| Key | Description |
|---|---|
| Window Colors | |
window_bg_color |
Main background color of the app. |
window_fg_color |
Default text color. |
| Number Buttons | |
card_bg_color |
Background for number buttons (0-9). |
card_fg_color |
Text color for numbers. |
| Operator Buttons | |
warning_bg_color |
Background for operators (+, -, /, x). |
warning_fg_color |
Text color for operators. |
| Function Buttons | |
headerbar_bg_color |
Background for functions (Sin, Cos, Log). |
headerbar_fg_color |
Text color for functions. |
| Accent / Equals | |
accent_bg_color |
The "Equals" (=) button background. |
accent_fg_color |
Text on the Equals button. |
| Destructive | |
destructive_bg_color |
Delete / Clear button background. |
destructive_fg_color |
Delete / Clear button text. |
@define-color window_bg_color #282a36;
@define-color window_fg_color #f8f8f2;
@define-color headerbar_bg_color #44475a;
@define-color headerbar_fg_color #f8f8f2;
@define-color card_bg_color #6272a4;
@define-color card_fg_color #f8f8f2;
@define-color accent_bg_color #bd93f9;
@define-color accent_fg_color #282a36;
@define-color warning_bg_color #ffb86c;
@define-color warning_fg_color #282a36;
@define-color destructive_bg_color #ff5555;
@define-color destructive_fg_color #282a36;You can style specific parts of the UI using standard CSS selectors.
The buttons in the keypad use the .calc-grid-button class.
.calc-grid-button {
background-color: #313244;
color: #cdd6f4;
border: 1px solid #45475a;
}
.calc-grid-button:hover {
background-color: #45475a;
}
.calc-grid-button:active {
background-color: @accent_bg_color;
color: @accent_fg_color;
}Operators often use the .accent class.
.calc-grid-button.accent {
background-color: @accent_bg_color;
color: @accent_fg_color;
}
.calc-grid-button.accent:hover {
filter: brightness(1.1);
}The sidebar (history/variables) uses .sidebar.
.sidebar {
background-color: @headerbar_bg_color;
border-right: 1px solid @headerbar_border_color;
}So you want a standalone binary to cherish forever? Fine.
- Install Prerequisites: You need Rust, GTK4, and Python development headers. Consult your distro's wiki for the specific incantations.
- Compile:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 cargo build --release --manifest-path desktop/Cargo.toml
- Locate the Artifact: The binary
neocalc_runner(orlauncher) awaits you intarget/release/. It needs to be run from the root directory so it can find thepythonfolder.
We use a Date-Based Versioning scheme to keep things fresh:
vYEAR.MONTH-REVISION
- YEAR: The current year (e.g.,
2025). - MONTH: The current month (e.g.,
12). - REVISION: An incrementing number for releases within that month (e.g.,
1,2,5).
This calculator assumes no liability for failed math exams or existential crises triggered by its output.
All the code is licensed under the GPLv3 license. You can check under LICENSE file for more details.