Replies: 1 comment
-
window.orderedWindows looks like probably my ticket for this one to avoiding tracking my own metadata via window filters. Credit to GPT-4o this time for that tip. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am making a neovim/neovide session picker using hs.chooser. This situation arises in many situations however.
I am attempting to contextually streamline multiple common behaviors into a single hotkey trigger:
The problem arises with the 2nd requirement. If there is more than one, bringing up a chooser would be reasonable. But, i want to streamline it one step further. I want to focus the most recently used open editor. The intended UX would be if I still want a chooser in such a situation i may simply hit the hotkey twice to bring it up.
My understanding of the standard way to figure out the most recently active windows/apps with HS is to use a window watcher/filter or something, and continually keep track in a data structure in the background whatever metadata is needed to whatever level of detail needed. That is fine, but I wonder if there are any simpler ways that we can query without managing our own state for
etc.
Failing that, it occurs to me that we could with a lot of "extraneous" UI manipulation I would be able to look at one stage of "previous" by hiding the active window; the OS at this point would reveal what would have been the previous window or app (i suppose it would depend on whether stage manager is in use) as a result of hiding the current one, and then I could proceed from there. That won't get me 100% of the way there (as it may well not be the editor i'm interested in) but the idea illustrates that some amount of state could be extracted.
Beta Was this translation helpful? Give feedback.
All reactions