Calculator
A calculator plugin that evaluates mathematical expressions and copies results to clipboard ![]()
installation
Run dms plugins install calculator
or install using the plugins tab on DMS settings
| Plugin Information | Value |
|---|---|
| id | calculator |
| name | Calculator |
| author | Bruno Cesar Rocha |
| repo | Link |
| capabilities | launcher |
| category | utilities |
| compositors | niri, hyprland |
| distro | any |
| dependencies | |
| requires DMS | >0.1.18 |
Calculator Plugin for DMS Launcher
A launcher plugin that evaluates mathematical expressions and copies results to the clipboard.

Features
- Real-time calculation: Type mathematical expressions directly in the launcher
- Default prefix: Uses
=as the default trigger prefix (configurable) - Safe evaluation: Only allows mathematical operations, preventing code injection
- Clipboard integration: Press Enter to copy the result to clipboard
- Multiple operations: Supports +, -, *, /, ^, %, and parentheses
Installation
Via DMS
dms plugins install Calculator
Via DMS GUI
- Mod + ,
- Go to Plugins Tab
- Choose Browse
- Enable third party
- install Calculator
Manually
cd ~/.config/DankMaterialShell/plugins
git clone https://github.com/rochacbruno/DankCalculator Calculator
- Open DMS Settings (Ctrl+,)
- Navigate to Plugins tab
- Click "Scan for Plugins"
- Enable the "Calculator" plugin with the toggle switch
Usage
With Default Settings (= Prefix)
- Open the launcher (Ctrl+Space)
- Type the
=prefix followed by a mathematical expression:= 3 + 3 - The result (
6) appears as a launcher item - Press Enter to copy the result to clipboard
Customizing the Trigger
You can configure a different trigger prefix or disable it entirely in the settings:
- Open Settings → Plugins → Calculator
- Change the trigger to a custom value (e.g.,
calc,c,math) - Or check "No trigger (always active)" to remove the prefix requirement
- In the launcher, type your configured trigger:
calc 3 + 3or just3 + 3(if no trigger) - Press Enter to copy the result
Adding a keybinding (niri)
binds {
Mod+Shift+C hotkey-overlay-title="Calculator" {
spawn "dms" "ipc" "call" "spotlight" "openQuery" "=";
}
}
Supported Operations
- Addition:
= 3 + 3→6 - Subtraction:
= 10 - 5→5 - Multiplication:
= 4 * 7→28 - Division:
= 20 / 4→5 - Exponentiation:
= 2 ^ 8→256 - Modulo:
= 17 % 5→2 - Parentheses:
= (5 + 3) * 2→16 - Decimals:
= 3.14 * 2→6.28 - Complex:
= (10 + 5) * 2 - 3 / 3→29
Examples
| Expression | Result |
|---|---|
= 3 + 3 |
6 |
= 100 / 4 |
25 |
= 2 ^ 10 |
1024 |
= (5 + 3) * 2 |
16 |
= 3.14159 * 2 |
6.28318 |
= 16 ^ 0.5 |
4 (square root) |
Security
The calculator uses safe expression evaluation:
- Only allows numbers, operators (+, -, *, /, ^, %), parentheses, and dots
- Rejects any expressions with letters or special characters (except operators)
- Prevents code injection by validating input before evaluation
Files
plugin.json- Plugin manifestCalculatorLauncher.qml- Main launcher componentCalculatorSettings.qml- Settings UIcalculator.js- Safe expression evaluation logicREADME.md- This file
Configuration
Settings are stored in ~/.config/DankMaterialShell/plugin_settings.json under the calculator plugin key:
{
"pluginSettings": {
"calculator": {
"trigger": "=",
"noTrigger": false
}
}
}
Troubleshooting
Calculator items don't appear:
- Make sure the plugin is enabled in Settings → Plugins
- Check that you're typing a valid mathematical expression
- Try disabling "No trigger" and setting a specific trigger
Result shows wrong value:
- JavaScript has floating-point precision limitations
- Very large or very small numbers may use scientific notation
Copy to clipboard doesn't work:
- Make sure your system clipboard is accessible
- Check console for error messages
Version
1.0.0
Author
Bruno Cesar Rocha
License
Same as DankMaterialShell