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

[feature] Tofi as fast calculator #172

Open
BoolmanO opened this issue Jun 1, 2024 · 3 comments
Open

[feature] Tofi as fast calculator #172

BoolmanO opened this issue Jun 1, 2024 · 3 comments

Comments

@BoolmanO
Copy link

BoolmanO commented Jun 1, 2024

I think it can be very helpful in some situations, so, maybe add some sort of option for calculator mode? If you don't want this, maybe add mode when tofi can accept output from some script or smth like that?

@partisani
Copy link

partisani commented Aug 30, 2024

I think the latter is the better option, because by implementing this, (depending on how its done) tofi will be useful for things like getting user input and allow anyone to make a tool that uses it if so desired

@DontBlameMe99
Copy link

This is how I implemented the calculator for myself. It uses tofi as the input and then just copies the result. I hope this can be of use for someone:

# Input operation
operation=$(echo "" | tofi --prompt-text="Math Operation: " --require-match=false)

# Calculate the result
result=$(echo "$operation" | bc -l)

# Copy the result to the clipboard
echo "$result" | wl-copy
notify-send "Result: $result" "The result has been copied to the clipboard."

@partisani
Copy link

like, how didn't i think of this before?

anyways, thanks for the tip

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

No branches or pull requests

3 participants