Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added calculator functionnality #217

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

F-4Dev
Copy link

@F-4Dev F-4Dev commented Feb 7, 2025

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:

  • 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
  • Entering " breaks the calculation module
  • Tofi seams to crash when trying to remove the last existing character
  • 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 #172 and #183

Sorry, something went wrong.

F-4Dev and others added 4 commits February 7, 2025 18:54

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] Tofi as fast calculator
2 participants