-
-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a scratchpad like there was in kwm? #379
Comments
There is currently no such thing in yabai. |
Wondering if there's been any thought on whether this will be added sometime in the far far future? |
If you minimize a window and save its window id (or label, if assigned one), you can move a minimized window to the current space and deminimize it with one command like this: yabai -m window <wid> --space $(yabai -m query --spaces --space | jq '.index') &&
yabai -m window --focus <wid>
|
@dominiklohmann that's a pretty hot tip. I'm gonna play around with that and see what I can do. Thanks! |
@hahuang65 were you able to replicate the scratchpad functionality in yabai? |
Nope. |
So one issue with the scratchpad functionality as it was in kwm, is that upon a crash any window that was on the scratchpad would be lost, as we used private APIs to remove it from all active spaces. I think it would probably be more suitable to integrate this with the built-in minimize functionality that macOS supports, as mentioned by @dominiklohmann If adding labels to windows are enough to support that; this can be implemented rather quickly. |
Labels are essentially just a shortcut for keeping a local cache of window identifiers on disk, they aren't even required to implement this. I don't have a use case for this myself and can't see myself using it, so I'm unlikely to spend further time on it, but I'd be available for help if someone wants to write a ready-to-use script for this. |
I also do not use this functionality, which makes it hard for me to reason about what a good solution is. I want to try and keep the core of yabai simple and given that I do not use this functionality it makes it hard for me to reason about what a proper solution to this would look like. I am leaning more towards the goal of giving the user enough power to create a scriptable solution for this, but as I said, I don't actually have much of an idea what would be required that is currently not possible. |
The only thing that's really missing for this is Edit: And a |
So the issue here is that minimized windows are not actually reported by the macOS APIs for most applications (for some reason Chrome does report these windows). Would it make more sense to add a separate |
|
Hmm I can actually deminimize a window without stealing focus using the AX API, if the application whom the window belongs to is not currently the frontmost application.
… On 20 Apr 2020, at 16:54, Dominik Lohmann ***@***.***> wrote:
--focus already deminimizes, and deminimized windows also always gain focus. I don't think an explicit --deminimize is needed.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#379 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABPDZVYEBL6QF3STITW24F3RNRO3FANCNFSM4KJ6KZPA>.
|
Hmm so I actually found a way to always report all minimized windows in the space query. I need to verify that this does not break existing logic, and then we can add |
To summarize (changes made to master): Minimized windows are now included in the result of window queries. Added command As mentioned by @dominiklohmann focusing a window will also deminimize it, and I've mentioned this in the documentation for the deminimize command. I felt that it might be worth having a separate command for it because of the following caveat that I discovered:
However, I might remove the This should be enough to make something like a scratchpad at a user level. |
Wow! that was fast! Thanks! |
@sainathadapa if you figure out how to script this, could you please post back here? I will do the same, but recent events have made my time to tinker pretty scarce unfortunately. |
Will do 👍 , although i might just make do with a single window in scratchpad at first. |
This works: current_space=$(yabai -m query --spaces --space | jq '.index')
yabai -m query --windows |
jq '.[] | select(.minimized == 1).id' |
xargs -L1 -I{} sh -c ' {
yabai -m window $1 --space $2
yabai -m window $1 --deminimize
} & ' sh {} $current_space It deminimizes all currently minimized windows on the current space. So you can add a window by minimizing it, and remove everything from the "scratchpad" by running the above command. |
So if I want to have 2 differently named scratchpads, and hotkeys to bring either one into or out of focus, I'll need to probably just select by |
That's one possibility. This is why I mentioned the labelling of windows above, as that makes sorting windows into multiple "scratchpads" easier. |
Hmm, so personally, for me, I'm not sure I'll need anything beyond just the |
Is there a way to re-size and then center a floating window? |
Here's my solution... please let me know if this works for you @sainathadapa...
|
note |
@hahuang65 may you share the apple script? |
I haven't used iterm in a LONG time, but this is the script from my git history
|
Scratchpad implemented on master for next release: #2203 (comment) |
Trying to have a couple of windows that work as floating scratchpads. Wondering if that's still a thing in yabai?
The text was updated successfully, but these errors were encountered: