nikitabobko / AeroSpace

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

on-workspace-touched callback #316

Open nikitabobko opened 2 months ago

nikitabobko commented 2 months ago

The proposal is to introduce on-workspace-touched callback. When the workspace is updated in any way (focused changed to/from the workspace, children are attached/removed, name/tag is changed (oh,fuck, see below))

Use case:

on-workspace-touched = 'echo %{workspace-mru-app-name} | xargs rename-workspace --tag'

It'd require introduction of workspace-mru-app-name interpolation variable ("MRU" stands for "most recently used")

Alternative names: on-workspace-used (similar to "MRU"), on-workspace-updated (Does "focusing the workspace" update it?)

Alternative. Allow interpolation variables directly inside rename-workspace? rename-workspace --tag %{workspace-mru-app-name}. Then, for the consistency, they should be allowed in literally all commands. workspace %{next-workspace}, focus --window-id %{left-window-id}, etc. jeez

Problem. Any command run inside the callback will probably change the workspace again. rename-workspace changes the workspace, which leads to infinite loop.

Possible solutions:

Depends on: #245 #278

nikitabobko commented 1 month ago

To consider: