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

Alias default menu items #41

Closed
FelixKratz opened this issue Sep 16, 2021 · 3 comments
Closed

Alias default menu items #41

FelixKratz opened this issue Sep 16, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@FelixKratz
Copy link
Owner

FelixKratz commented Sep 16, 2021

I think it would be super cool if we could alias default menubar items in sketchybar. I have some menubar apps that I really like (specifically: meetingbar) and that are complicated to replace with shell scripting.
I would thus like to have the ability to snag, e.g. meetingbar, from the default menubar into sketchybar. I know this is possible, because bartender has something like this.

What I think is needed:

  • Get the window of a menubar item, most likely through something like
CGError SLSGetProcessMenuBarWindowList(... dont know signature yet ...)
  • Unregister the menu item window from the default bar via something like
CGError SLSUnregisterWindowWithSystemStatusBar(CGSConnectionID cid, CGWindowID wid);
  • Move the window into the correct sketchybar bounds and order it on top

I am not exactly sure how Bartender is doing this, but it requests screen capture access, which leads me to believe that they might be recording the
bar item window and then place the capture inside of their bar.

Maybe someone has an idea on how to do it properly, or knows someone who could have an idea?
Could also be that such a feature would be a bit too sketchy, though...

@FelixKratz FelixKratz added enhancement New feature or request help wanted labels Sep 16, 2021
@FelixKratz
Copy link
Owner Author

I have checked the binary of Bartender, and they indeed seem to do it via the above mentioned SkyLight call:
bartender_item_grab

@FelixKratz
Copy link
Owner Author

Very crude first implementation which will segfault at every opportunity it gets, when not doing very specific setup tasks 86da5be. Will polish this some time soon.

@FelixKratz FelixKratz added this to the Next Minor Release milestone Sep 20, 2021
@FelixKratz
Copy link
Owner Author

As of 2012375 this is pretty nice to use. Click actions still missing, I dont need them however.

@FelixKratz FelixKratz unpinned this issue Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant