Comments (4)
Hi there, thank you for a proposal and sorry for a long response!
To be honest this proposal sounds quite a strange feature request for me, hah. While it may seem like a useful feature to you I'd like to note some downsides:
- Broken single responsibility principle (i.e. it's no longer just a app launcher, but also a calculator);
- Potential code complexity (code for parsing, evaluating and additional code for rendering may take up to +30-40% of current codebase size);
- Current version supports several "magical" separators (#19), which may increase parsing complexity.
Personally I use a python interpreter for that case (any other interpreted language also should work fine). Is there any problem with that solution for you? What kind of complexity from these expressions do you expect, only a basic arithmetic (i.e. +
/-
/*
//
) or something else as well? Do you need/expect an arbitrary precision calculation? What behavior do you expect when the expression and the result does not fit a single line? Do you have any other examples where the similar feature is integrated besides Spotlight?
from yofi.
Broken single responsibility principle (i.e. it's no longer just a app launcher, but also a calculator);
Or just advanced app launcher 😆
Potential code complexity (code for parsing, evaluating and additional code for rendering may take up to +30-40% of current codebase size);
We can just use fastval crate or something like that.
Personally I use a python interpreter for that case (any other interpreted language also should work fine). Is there any problem with that solution for you?
I also use python for that, but it takes some time to launch and it's easier to just use $mod+d and write expression.
What kind of complexity from these expressions do you expect, only a basic arithmetic (i.e.
+
/-
/*
//
) or something else as well?
Basic arithmetic would be great, however functions like sqrt() or cos() would be great to add.
Do you need/expect an arbitrary precision calculation?
Yeah that would be great.
What behavior do you expect when the expression and the result does not fit a single line?
Not sure about that, Spotlight solves that by expanding search view.
Do you have any other examples where the similar feature is integrated besides Spotlight?
If you don't find this feature useful, it's completely fine.
Thanks for response
from yofi.
Cool, thanks for detailed answers!
I don't consider the feature useless, just felt it slightly outside of project scope. But potentially it's indeed might be very handy. Unfortunately I have no time for that, but still I would like to accept a PR (and help with the code if needed).
What behavior do you expect when the expression and the result does not fit a single line?
Not sure about that, Spotlight solves that by expanding search view.
So far, it's easier implement it without handling that case. For now there's no handling for overflowed input value.
from yofi.
Math expr evaluations is something that I miss the most from OSX too (paste & copy the result also).
Thank you for pointing Albert @gbaranski I will have to try it!
from yofi.
Related Issues (20)
- Chinese rendering is too slow HOT 3
- Fonts registered by fontconfig fail to load resulting in panick HOT 4
- Long lines with marquee-like animation
- Support right-to-left languages
- gvim icon failed to load HOT 1
- Config for tuning fuzzy match
- Look into ~/.local/share/icons/ for icons HOT 1
- Crash: failed to initialize fontconfig HOT 6
- Add support for adaptive height when using layer shell mode HOT 3
- Add option to draw border around yofi window HOT 3
- feature request: (optionally) start with an empty result list HOT 1
- uses outdated rust compiler version HOT 1
- Search for .desktop program files for nix installed programs. HOT 1
- [Package Request] Void Linux HOT 1
- Panic when no apps match query HOT 2
- Yofi Layer Shell / Input exclusivity, doesn't get destroyed without stopping the program.
- Panic on launch after Hyprland update HOT 2
- run-time error: No such file or directory HOT 4
- [BUG] Flake nix run fails on NixOS + [Features] add direnv support, update flake HOT 3
- [Feature request] Parameter for config path HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yofi.