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

Add environment variables to all callbacks #351

Open
tobiasgiese opened this issue Aug 1, 2024 · 1 comment
Open

Add environment variables to all callbacks #351

tobiasgiese opened this issue Aug 1, 2024 · 1 comment

Comments

@tobiasgiese
Copy link
Sponsor

tobiasgiese commented Aug 1, 2024

Having environment variables like AEROSPACE_FOCUSED_WORKSPACE and AEROSPACE_PREV_WORKSPACE in all callbacks would be helpful. Especially while using other tools like sketchybar for instance. Having those envs will reduce aerospace queries and will lower resource consumption.

Additionally, further environment variables would be useful. Some ideas that I have in my mind:

AEROSPACE_FOCUSED_MONITOR_ID: the current focussed monitor id
AEROSPACE_WORKSPACE_MONITOR_ID: the monitor id for the workspace
AEROSPACE_WORKSPACE_WINDOWS: the windows in the workspace

xref #230 (comment)

@nikitabobko
Copy link
Owner

nikitabobko commented Aug 2, 2024

I just realized that after we fix #278 there won't be a need in environment variables in callbacks

on-focus-changed = '''
    exec-async sketchybar --trigger aerospace_workspace_change "FOCUSED_WORKSPACE=$(list-workspaces --focused)"
'''

It will be as fast as environment variables because everything is executed in process right when the callback is called

But we also need to provide list-workspace --prev-focused as a replacement for AEROSPACE_PREV_WORKSPACE

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