svenstaro / rofi-calc

🖩 Do live calculations in rofi!
MIT License
991 stars 32 forks source link

qcalc spawning behavior change #66

Closed bootstrap-prime closed 1 year ago

bootstrap-prime commented 3 years ago

I changed the behavior of calc_preprocess_input to only call qcalc when the input string changes. This is a partial solution to #40. I'm still learning C so I may or may not have a better solution for this later on.

svenstaro commented 2 years ago

@bootstrap-prime Are you interested in following up on my little review?

bootstrap-prime commented 2 years ago

absolutely, sorry for the delay.

bootstrap-prime commented 2 years ago

I sort of figured out how to make this better - spawn an interactive qcalc session and then pipe up inputs and outputs. Unfortunately, it seems that gio g_inputstream* doesn't have the ability to read, and then return after a timeout, and I'm not familiar enough with async here to implement a cancel. I thought I could get around this by just directly using libqalculate, but it's C++ and this project is pure C. libqalculate may expose a C abi, but I'm not sure how to use it or what to look for.

svenstaro commented 2 years ago

Shall I take a proper look at this PR or do you wanna research this topic further first?

bootstrap-prime commented 2 years ago

I don't think I have the motivation to continue, honestly. Most of the window opening spam is removed, so this is probably a good stopping point.

svenstaro commented 1 year ago

Sorry for forgetting about this for so long. Finally merged it. Thanks!