ganit गणित
a Vyom tool

ganit

गणित · “mathematics”

Calculator and converter: answers as you type (math, units, currency, percentages) through qalc, with a history.

यथा शिखा मयूराणां नागानां मणयो यथा ।
तद्वद्वेदाङ्गशास्त्राणां गणितं मूर्धनि स्थितम् ॥

Like the crest of a peacock or the jewel of a serpent, mathematics stands at the head of the Vedāṅga sciences. Vedāṅga Jyotiṣa, Yājuṣa recension 4 (the Ārca recension, v. 35, reads ज्योतिषं for गणितं)
v0.5.0 latest10 releases6 decisions recordedMIT license

ganit: calculator panel

Ganit (गणित) is Sanskrit for "mathematics": the sums, conversions and currencies, answered as you type.

ganit is the calculator and converter for Vyom: one keyboard-driven panel that opens instantly, with live data, a preview and a key for everything. It runs on any compositor with the layer-shell protocol (sway, Hyprland, river, niri, Wayfire, labwc…). In Vayu, the desktop it was built for, it replaces wofi-calc.sh (a prompt, then a second wofi for the result).

#Features

Calculate (vyom ganit): a calculator with a paper tape, that stays open like a real one.

Convert (vyom ganit convert, or L from Calculate): a two-sided converter.

ganit: the Convert tab

Both: keyboard first, with vim's modes and a Space leader (the footer shows the keys, ? all of them), Space u f (or F11) makes it fullscreen, and the panel never freezes: qalc runs in the background.

#Install

#Requirements

#Install

git clone https://github.com/Theyashsawarkar/ganit ~/.local/share/vyom/plugins/ganit
vyom reload           # pick it up (or log out and in)
vyom ganit            # open it; run it again to close

Give it a key in your compositor, e.g. sway:

bindsym $mod+<key> exec vyom ganit

#Update and uninstall

git -C ~/.local/share/vyom/plugins/ganit pull && vyom reload     # update
rm -rf ~/.local/share/vyom/plugins/ganit && vyom reload          # uninstall

#Usage

Open it with vyom ganit (or your key), or straight on Convert with vyom ganit convert. Calculate opens in insert mode, so you can type a sum at once (Convert opens in normal mode, so a stray key changes nothing); Enter runs it and keeps it on the tape, and the panel stays open.

Keys work like vim. In insert mode, keys type: only Enter (run or save) and Esc (to normal mode) do something else. Every other key belongs to normal mode:

Tabs: H / L (and vim's gt / gT, Tab), or Space t c / Space t v. Keys that moved in v0.5 say where they went for one release.

Vyom's keys work too (every vim tool has them): ? and Space ? list every key, Space Space is the palette, H / L switch tabs, q closes, Space u f is fullscreen.

Insert mode (typing), Calculate

KeyAction
EnterRun the sum and keep it on the tape; stays in insert mode

Insert mode (typing), Convert

KeyAction
EnterSave the conversion to the list; stays in insert mode

Normal mode, both tabs

KeyAction
iEnter insert mode to type (Esc goes back to normal)
aEnter insert mode at the end of the box

Normal mode, Calculate

KeyAction
jMove down the tape (a count moves further: 5j; past the end, back to the box)
kMove up the tape (a count moves further: 5k)
g gJump to the first tape line
GJump to the last tape line
EnterRun the sum and keep it on the tape (a picked line: put its sum in the box)
=Run the sum and keep it on the tape
y yCopy the answer (the picked line's, else the live one)
YCopy the sum with its answer (12 + 5 = 17)
pPaste the answer at the end of the box
PPaste the picked line's sum into the box, replacing what's there
xDelete the last character in the box
DClear the box
c cClear the box and enter insert mode
SClear the box and enter insert mode
d dDelete the picked tape line, else the last (u brings it back)
uUndo the last deleted tape line
mSave the answer to memory (mem in a sum uses it)

Normal mode, Convert

KeyAction
jMove to the To amount
kMove to the From amount
hSwitch this side's unit to the previous one (a count: 3h)
lSwitch this side's unit to the next one (a count: 3l)
[Switch to the previous kind (currency, length, mass…)
]Switch to the next kind
sSwap From and To
EnterSave the conversion to the list
=Save the conversion to the list
y yCopy the converted amount
YCopy the whole conversion (100 USD = 9,392.25 INR)
xDelete the amount's last character
DClear the amount
c cClear the amount and enter insert mode
SClear the amount and enter insert mode
d dDelete the newest saved conversion (u brings it back)
uUndo the last deleted conversion

Leader (Space), both tabs

KeyAction
Space t cSwitch to Calculate
Space t vSwitch to Convert
Space rUpdate the exchange rates now

Leader (Space), Calculate

KeyAction
Space y yCopy the answer
Space y eCopy the sum with its answer
Space y pCopy the answer as a plain number
Space y xCopy the exact answer (fractions, roots)
Space y hCopy the answer in hex
Space y bCopy the answer in binary
Space v sSave the answer to memory
Space v pPaste mem into the box
Space v cClear the memory
Space d tClear the whole tape (y confirms)
Space d bClear the box

Leader (Space), Convert

KeyAction
Space e fPick the From unit (type to filter, Enter picks)
Space e tPick the To unit (type to filter, Enter picks)
Space y yCopy the converted amount
Space y fCopy the From amount
Space y lCopy the whole conversion
Space y rCopy the rate (1 USD = 93.92 INR)
Space m pToggle the pin on the To currency (pinned ones show below)
Space a aSave the conversion to the list
Space d dDelete the newest saved conversion
Space d aClear every saved conversion (y confirms)
Space g cSwitch to currency
Space g lSwitch to length
Space g mSwitch to mass
Space g tSwitch to temperature
Space g vSwitch to volume
Space g dSwitch to data
Space g sSwitch to speed
Space g aSwitch to area
Space g iSwitch to time

#Configuration

[plugin.ganit] in ~/.config/vyom/config.toml, all optional:

OptionDefaultWhat it does
home"INR"Your currency: Convert starts from USD to it
currencies["INR", "USD", "EUR", "GBP", "AED", "JPY", "SGD"]The pinned currencies, until you pin or unpin one with Space m p
start_modeCalculate "insert", Convert "normal"The mode it opens in: "insert" (type at once) or "normal" (for both tabs)
grouping"intl"Digit grouping: "intl" (1,234,567), "indian" (12,34,567) or "none"

#Troubleshooting

#The Vyom family

Each tool is its own repository, so you install only the ones you want:

ToolWhat it does
dvaraद्वार, gatewayThe app launcher
ganit (this one)गणित, mathematicsThe calculator and converter
smritiस्मृति, memoryClipboard history
bhavaभाव, feeling, emotionThe emoji picker
tarangतरंग, waveWi‑Fi and the hotspot
setuसेतु, bridgeBluetooth
dootदूत, messengerYour phone, through KDE Connect
patraपात्र, vesselDocker containers
akashvaniआकाशवाणी, voice from the skyNotifications
ragaराग, melodyYouTube music and video
mudraमुद्रा, gestureKeybinding search
urjaऊर्जा, energyThe battery at a glance
vishramविश्राम, restThe power menu
kendraकेन्द्र, centreQuick settings

#Contributing

Bug reports, ideas and pull requests are welcome: see CONTRIBUTING.md for the development setup and the few rules every tool follows, and CHANGELOG.md for what changed in each release. Please report security issues privately (SECURITY.md).

#License

MIT.