svenstaro / rofi-calc

🖩 Do live calculations in rofi!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change input into result when submitting

agsti opened this issue · comments

First of all sorry if this is documented somewhere or I can use some other tool to achieve said behavior, I have tried a few flags and read the documentation.

I'm looking for a way to change the current input into the result when submitting, a behavior similar to what spotlight on OSX does.

Example:
Input: 7+4
Press enter (or something else)
current input is 11, and cursor on the right

Thanks, great work btw!

commented

If you have xdotool installed you could use this, it works great for me:

rofi -modi calc -show calc -calc-command 'xdotool type --clearmodifiers "{result}"'

You need to use CTRL+Enter to trigger the command though.

This will also not overwrite the entire current input, but only insert the text at your cursor. But if you wanted to you could easily add that with xdotool as well.

That would make a great addition to the examples in the readme if you feel up for it. :)

@agsti Can we consider this addressed, then?

Yeah that's good enough! I'll give it a go, thanks