hammerspoon icon indicating copy to clipboard operation
hammerspoon copied to clipboard

hs.window.filter startup times

Open r2evans opened this issue 11 months ago • 3 comments

I'm adapting the AppWindowSwitcher spoon for some personal use-cases (i.e., windows without bundle-ids), and one tactic I'm doing is recording the creation/deletion of windows. However, this line takes around 10-15 seconds:

    hs.window.filter.new(true):subscribe(
        { hs.window.filter.windowCreated, hs.window.filter.windowDestroyed },
        myfun, true)

Is there a way to speed up this instantiation? I don't think coroutines are feasible, at least not from my user-code, since this is a single call where I cannot add/control things like yield.

Admitteldy I'm new to lua (not programming), so if I'm missing something obvious, my apologies. Thanks!

r2evans avatar Dec 09 '24 20:12 r2evans

SAME!

megalithic avatar Dec 20 '24 19:12 megalithic

Maybe related: #3574

QuantumLibet avatar Dec 20 '24 21:12 QuantumLibet

#3712

avegetablechicken avatar Mar 28 '25 17:03 avegetablechicken