nikitabobko / AeroSpace

AeroSpace is an i3-like tiling window manager for macOS
https://nikitabobko.github.io/AeroSpace/guide
MIT License
8.07k stars 131 forks source link

Add window condition for executable path prefix #359

Open graywolf opened 3 months ago

graywolf commented 3 months ago

Hello,

I am trying to use the on-window-detected callback to move a window, and I am having trouble differentiating between two windows with the same application id. The application in question is Firefox. I need to have two separate profiles running at the same time, one for hardened browsing, other for Zoom. Using cp -r I ended up with /Applications/Firefox.app and /Applications/Firefox for Zoom.app. It works fine it seems.

However when I want to place one firefox on workspace 2, and other on workspace 4, I am unsure how to currently do it. Both have the same application id, so if.app-id cannot be used. Matching on window title will not work either, since the title differs based on the active tabs.

The solution for me would be to introduce new condition, for example if.app-path-prefix, so I could do

[[on-window-detected]]
if.app-path-prefix = '/Applications/Firefox.app/'
run = 'move-node-to-workspace 2'

[[on-window-detected]]
if.app-path-prefix = '/Applications/Firefox for Zoom.app/'
run = 'move-node-to-workspace 4'

Thank you for considering this feature.

(As off-topic note at the end, thank you, AeroSpace is great. When I was forced to switch to Mac few days back, the usability was horrible. Then I installed AeroSpace, ported over my i3 config, and suddenly I no longer want to shoot my brain out. So, thanks a lot.)

nikitabobko commented 3 months ago

Feature like this makes total sense. Some GUI applications don't even have a App Bundle ID (If I remember correclty, Android emulator is such)

But since I plan to implement an alternative syntax for on-window-detected callback #278 , I want to finish that first before adding any new features to the callback