Skip to content
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 Way to switch between multiple windows (one of the windows maybe in minimized) of the same app via shortcuts? #2540

Open
charlielin opened this issue Feb 12, 2025 · 3 comments

Comments

@charlielin
Copy link

I've been searching for a solution for a long time without success. I want to use keyboard shortcuts to quickly switch between two windows of the same application (especially Arc Browser). I know Command + ~ partially works, but it only functions when both windows are in the foreground. If one window is in the background, there's no way to bring it forward using this shortcut.

@Bellavene
Copy link

Bellavene commented Feb 13, 2025

Command + `

What do you mean by background? It is a classic macos shortcut, works on all windows except minimized.

@charlielin
Copy link
Author

Command + `

What do you mean by background? It is a classic macos shortcut, works on all windows except minimized.

Sorry for my unclear expression. When I said "background", I actually meant "minimized".

@charlielin charlielin changed the title Is There A Way to switch between multiple windows (one of the windows maybe in background) of the same app via shortcuts? Is There A Way to switch between multiple windows (one of the windows maybe in minimized) of the same app via shortcuts? Feb 13, 2025
@Bellavene
Copy link

Bellavene commented Feb 13, 2025

You could write and bind a script to replace the standard behavior as you want.
I am ok with the usual behavior, so I use additional bind Command + Shift + M for unminizing windows.
You can bind and use this apple script to unminimize last minimized window

#!/usr/bin/env osascript
try
    tell application "System Events" to tell process "Dock"
        click (last UI element of list 1 where role description is "minimized window dock item")
    end tell
end try

Or this one-liner shell script

yabai -m window --deminimize $(yabai -m query --windows id,is-minimized | jq -r '.[] | select(."is-minimized"==true).id')

This one to unminimize all minimized windows

#!/usr/bin/env osascript
tell application "System Events" to tell process "Dock"
    click (UI elements of list 1 where role description is "minimized window dock item")
end tell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants