Comments (16)
Is 5e1e363 fix this issue?
from zaw.
At least, I love it because I wrote it :) @sorin-ionescu 's idea of 'kMDItemKind == "Application"' would be
- a more accurate and thorough way determining applications
- extremely slow taking minutes at least on my host to return the results (and subsequent runs don't seem to get much faster either)
- dependent on Spotlight indexing being enabled
Given those at least I prefer what I implemented. However, I also have 'locate' installed and running and getting candidates via "locate -i .app | grep '.app$'" for this is probably a better alternate implementation that I might end up implementing sometime.
from zaw.
Depending on Spotlight is a better implementation. Who disables Spotlight indexing? Anybody? It's a non-issue.
from zaw.
Quick googling for spotlight indexing "disable" should convince you otherwise. Initial releases on Mountain Lion and IIRC evan Lion had a lot of slow, repetitive, high cpu indexing issues.
Even ignoring that slow execution of the spotlight query still would remain the bigger issue.
A solution with selective enabling/disabling of these implementation (mdfind, locate, glob) would be the way I'd go about it. That way everybody could be happy. Heck we could just create a separate source altogether.
from zaw.
@sorin-ionescu : You can try out the junkblocker@dfdea54 which implements your suggestion with
export ZAW_SRC_APPLICATIONS_USE_MDFIND=1
to see how well it does or does not work.
@nakamuray It would be good to to have a zstyles facility for source specific settings to avoid such environment variables. Please let me know your thoughts and/or if you want me to file an issue for that.
from zaw.
While there have been Spotlight bugs, said bugs were fixed.
Environment variables should not be needed since zaw works in the same Zsh process, does not it?
from zaw.
Yes, but still mdfind query slowness point is the problem. It takes minutes for the query to come back.
And yes, you are correct about not needing to export
it.
from zaw.
time mdfind 'kMDItemKind == "Application"'
0.02s user 0.02s system 60% cpu 0.066 total
from zaw.
I am getting these sorts of numbers instead from two different Macbook Pros one 3 years old and another 6 months old both running Mountain Lion latest with 8G ram.
mdfind 'kMDItemKind == "Application"'
0.03s user 0.09s system 0% cpu 4:43.44 total
However now knowing how long it should take, I figured out what is happening. I have a local encrypted dmg ~/something.dmg
mounted as a volume at /Volumes/something
which is being indexed too (on both laptops). If I unmount the volume, the times start matching yours. Spotlight is likely not indexing the mounted volumes but doing a find in it instead or actively updating the index from it (the content in it changes a lot).
So, changing the query to search on /
only works:
time mdfind -onlyin / 'kMDItemKind == "Application"'
0.01s user 0.01s system 23% cpu 0.098 total
and I am fine with not getting results from mounted volumes, local or remote. I'd still leave globbing as a fallback in case mdfind returned nothing as in the implementation I pointed you at. I'll make it default and propose this if it is ok with you.
from zaw.
-onlyin /
is good enough.
from zaw.
Sent pull request with slight change of using all of the available sources for completeness sake as mdfind
is not listing apps inside apps. See proposed commits for comments.
from zaw.
I don't think it should list apps inside apps. I don't see where you would ever want to run an app inside an app. Those apps are dependencies of the main app.
from zaw.
Hmm, I am kinda split on this. I was able to just launch a couple of useful sub apps using this, however yeah most of these internal apps do seem not to be usable directly. I'd still like to keep the feature though. Any suggestions? Maybe hide it behind an environment variable? Wishing for zstyle for sources very strongly right about now.
from zaw.
Ok, made locate use optional since it is taking about 5 seconds with it and also by default turned off internal apps. junkblocker@0363cd2 .
from zaw.
#23 was merged. Can I close this issue?
from zaw.
Yeah, it should be closed.
from zaw.
Related Issues (20)
- No fuzzy search?
- ANSI color codes in candidates
- ANSI color codes in candidates HOT 1
- Action not executed
- after installation with zplug, zaw does nothing in response to ^x HOT 1
- Can I swap/use custom keybindings default action and alternative action? HOT 2
- zaw from stdin ? HOT 4
- fasd input displayed in reverse order
- Arguments not passed to source
- no_short_loops breaks Zaw compilation HOT 1
- Does zaw support Shift+Tab? HOT 2
- Keybindings for alternative options HOT 3
- zle: widgets can only be called with ZLE is active HOT 5
- "No such widget" error HOT 2
- Enter executes command instantly HOT 1
- Maintenance HOT 1
- Error when using `zsh-syntax-hightlighting` with `zaw` HOT 3
- Document for writting zaw source
- zaw-action:2: number expected HOT 2
- Default action does not working on zsh 5.0.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 zaw.