svenstaro / rofi-calc

🖩 Do live calculations in rofi!
MIT License
966 stars 31 forks source link

Not working in combi mode #33

Closed supermar1010 closed 4 years ago

supermar1010 commented 4 years ago

Hi, the plugin works for me if I launch rofi with the supplied command. But I want it to be available in combi mode. I tried adding it to the list of modes but it doesn't work. If I type something like 5*3 I get one entry saying "calc Add to history" but no result. Do you know what the problem is?

My config file:

rofi.modi:                           combi

rofi.combi-modi:                     window,drun,ssh,calc
svenstaro commented 4 years ago

To be honest this is quite the abuse of rofi in general and I don't really expect it to work in combi mode. I tried before.

DaveDavenport commented 4 years ago

While it would be fun, I don't expect this to work in combi mode.

Maybe in the future we can discuss how to make this possible.

supermar1010 commented 4 years ago

Ok thats unfortunate I hoped to be able to have a calculator integrated in my rofi :( If you make it work you'd make my day :D if you need a tester feel free to tag me

mia1024 commented 3 years ago

This is definitely a hackish solution but I got this working. It's a bit inconvenient but probably better than nothing.

I can run rofi -show combi -combi-modi calc:~/show_calc.sh,window,drun, and inside my ~/show_calc.sh I have

#!/bin/bash

if [[ -z "$1" ]]; then
    echo "Show calculator"

else
    kill `pidof rofi` 
    # so rofi doesn't complain "can't launch rofi inside rofi"
    rofi -show calc
fi

So there's always a single entry that lets me go into the calculator mode.

BillyCroan commented 6 months ago

To be honest this is quite the abuse of rofi in general and I don't really expect it to work in combi mode. I tried before.

I'm very new to rofi. But.... as highly customizable as rofi is, why is this "abuse"? If it can't combi, what's the point? if one has to give up all app selection to gain calc functionality why use rofi at all?

If you have to "chainload" a rofi in calcmode from a rofi in combi as @mia1024 suggested then you might as well chainload gnome-calculator right?

DaveDavenport commented 6 months ago

you can open multiple modes in rofi and switch between them within rofi.. No need to 'chainload' anything.

combi mode was designed for having window,drun combined, so if you type in f.e. 'firefox' it would switch to the open firefox if was already running or launch it when not. You can use the normal mode selection to have multiple modes open and access them within the same instance.

(rofi -show windows -modi "window,drun,calc,file-browser" then use the relevant keybindings to switch between or jump to right mode)

BillyCroan commented 6 months ago

so I would launch rofi, click a tab, and then type the math I need it to do? (yes) how is that easier than launch rofi, click an icon, and type the path I need to do?

What I'm saying is one of the powerful things about rofi is combi mode -- that you can start forming your query withOUT telling rofi what category of query it is. And rofi applies that query in all categories and returns all available results.

combi mode saves the step of specifying what kind of query you're making (window, drun, run, etc) eliminating steps. manually switching tabs in rofi is ADDING another step. It's not a huge step. But it is undeniably, A step.

On Thu, Mar 7, 2024 at 7:10 AM Dave Davenport @.***> wrote:

you can open multiple modes in rofi and switch between them within rofi.. No need to 'chainload' anything.

— Reply to this email directly, view it on GitHub https://github.com/svenstaro/rofi-calc/issues/33#issuecomment-1983474663, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAJFU5BIY2HEHH4474TK3TYXBRMVAVCNFSM4I2UI6MKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJYGM2DONBWGYZQ . You are receiving this because you commented.Message ID: @.***>

DaveDavenport commented 6 months ago

Things are what they are. There is a technical reason why things work they way they currently work. (as I tried to explain on IRC) As stated above, a discussion can be had on how to improve this:

Maybe in the future we can discuss how to make this possible.

I tried to help by giving an alternative that would work in current version of rofi that would imho be better then daisy chaining. ~I see this was not appreciated.~

~Repeatedly pointing out that calc does not work in combi mode and how this is not as good as it could be is not very constructive to this issue given this was already acknowledged.~ ignore this. does not contribute either.

DaveDavenport commented 6 months ago

I'm very new to rofi. But.... as highly customizable as rofi is, why is this "abuse"? If it can't combi, what's the point? if one has to give up all app selection to gain calc functionality why use rofi at all?

If I remember correctly albert and ulauncher might be more suited for your use-case: https://albertlauncher.github.io/ / https://ulauncher.io/. I thought it integrated launcher and calculator in that fashion.'