Added calculator functionnality
We've extended the codebase to allow for modules like doing math or doing a web search to be added fairly easily.
This pull request includes those two examples. Modules are asked to add their suggestion to the results array, importantly module suggestions must start with a prefix (e.g. = for calcuations ? for searches). Then when the user selects the result of an module, the module can process text-input and its own suggestion to do a task. All modules can be disabled in the config file.
The Math modules uses qalc or libqalculate from the AUR as the "calculation backend" which is now a required dependency (at least we think so)
The PR also includes functionality for the delete key to remove the next character :D
Still todo is:
- [x] Documentation about this feature
- [ ] Also add this modules functionality to non drun
- [ ] Maybe add a way to have a better module prefix system (TBD)
- [ ] Tofi seams to not end its process when executing the math module
(A temporary fix for that is adding
&& wl-copy ""behind your key bind) - [x] Entering
"breaks the calculation module - [x] Tofi seams to crash when trying to remove the last existing character
- [x] Add extended configuration for the search module (change search engine or browser) and find a way to utilize the default browser
Sadly ^ cant be used for e.g. doing math, presumably it's a "dead key" and there doesn't seam to be any easy workaround. You can still use ** to do exponents though: e.g. 3**4 = 3⁴
Should close https://github.com/philj56/tofi/issues/172 and https://github.com/philj56/tofi/issues/183