Comments (8)
Hi, not so far. The main problem is still as written above; I don't think there's a good way to make this quick. I do plan on having a more detailed look into this at some point, as it may not be as slow as I thought (especially SVG rendering, a random set of benchmarks suggest that resvg could be fast enough). There's other, easier improvements to make first though.
from tofi.
Not dumb at all
The main problem with that is just complexity. For context, at an extremely simplified level, tofi's architecture is pretty much:
initialise_everything();
while (true) {
wait_for_keypress();
handle_keypress();
render();
}
Everything is single-threaded, as just the time taken to spawn and join new threads makes them not really worth it at the 1-2ms level.
The dependencies are split into a few categories:
- Drawing (Cairo)
- Text rendering (FreeType, HarfBuzz, Pango)
- Wayland (libwayland, xkbcommon)
- Miscellaneous (GLib - already required by Cairo / Pango / Harfbuzz)
To add lazily-loaded icons implies a few things:
- Logic to find and load icons (quite complicated as mentioned above, but not too bad)
- At least some level of multi-threading (probably just a single extra thread loading & passing icons back to the main thread)
- Dependence on an SVG library (libpng is "free", as it's already depended upon by FreeType / Cairo)
None of these are show-stoppers, but altogether it implies a fair amount of extra complexity. Combined with the fact that icons will never be as fast as the rest of tofi, they're pretty low on my priority list. I do still plan on giving them a more thorough go at some point though, as I understand the demand is fairly high (I guess it's the biggest feature that tofi's missing compared to rofi).
from tofi.
I knew someone would ask eventually
from tofi.
Ok, so this has turned out to be much more complicated than I'd feared. There's a combination of factors:
- The icon theme spec is really quite complex.
- The icons apps provide are inconsistent, so I'd have to implement both SVG rendering with librsvg and scaling of PNGs to not have missing icons.
- The real killer: there's no good way to cache the necessary icons, as these can change e.g. every time you change your tofi config or switch to a different monitor. Without caching, the lookup will be very slow every time, which goes against the nature of tofi. Even in rofi, which is generally an order of magnitude (or more) slower to startup, icon loading is delayed until after startup, causing pop-in and more complexity.
Given all that, and the fact that I never used to use them in rofi anyway, I'm gonna abandon icons for now, though I may come back to it or look at it when I've got nothing else to do.
from tofi.
Hello. Any news about this feature?
from tofi.
@philj56 how about lazy loading the icons? So we show the list of results first with a placeholder for icon (so it does not change width and high of the list items when they are loaded) and load the icons when there are ready.
Is that possible or are there other things that will not allow this approach?
I am new in that space so sorry if it's a dumb question.
from tofi.
Maybe put the extra complexity in a seperate tool like tofi-thumbnailer. It could produce png from svg so that there is no extra dependency within tofi. It would also address the performance issue
from tofi.
For icons in general one can always use font awesome or some unicode icons but then the assignment has to be done manually
from tofi.
Related Issues (20)
- Add support for Alt key HOT 3
- Customisable keybindings HOT 3
- integration with cliphist HOT 7
- wl_seat@11: error 0 HOT 4
- tofi no longer displaying flatpaks in search HOT 3
- add support for change of individual letters color in the prom-text HOT 2
- Segmentation fault on Ubuntu HOT 6
- Dont oppening programs in terminal HOT 3
- Does tofi support #SUDO_ASKPASS ? HOT 1
- Add possibility to act on selection HOT 1
- Display as a normal window HOT 1
- Select only option left HOT 5
- Cannot find the tofi window HOT 3
- Feature Request: `--accept-single` HOT 3
- gibberish when loading font file HOT 4
- Prefix Matching? HOT 3
- Fallback matching HOT 1
- Add Ctrl-[ keybind to close tofi HOT 5
- How to enter a result that is not listed HOT 2
- Tests fail on i686 HOT 2
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 tofi.