FelixKratz / SketchyBar

A highly customizable macOS status bar replacement
https://felixkratz.github.io/SketchyBar/
GNU General Public License v3.0
6.67k stars 97 forks source link

Alias click events? #510

Closed FormalSnake closed 9 months ago

FormalSnake commented 9 months ago

Hi, so I want to add some aliases in Sketchybar but when I click on one it doesn't do anything. If it is possible it would be cool that if I click on one it does whatever it would do in the normal menubar.

FelixKratz commented 9 months ago

It is possible to make this the click action of the item, however, as discussed in #236 it does not properly reposition the popup.

I currently have something like this for my new config with the app menus:

https://github.com/FelixKratz/SketchyBar/assets/22680421/39e3ecbd-d2ce-4058-b361-ef8393868383

FormalSnake commented 9 months ago

It seems to work perfectly in your demo, could you provide a snippet for that click action? It seems great.

lcjnil commented 9 months ago

It is possible to make this the click action of the item, however, as discussed in #236 it does not properly reposition the popup.

I currently have something like this for my new config with the app menus:

demo.mp4

This is awesome, will you share your dot files in the future?

FormalSnake commented 9 months ago

@FelixKratz how do I use multiple aliases for the same app? I want to use some raycast menu bar items but I do not know how to specify which one must use which.

FelixKratz commented 9 months ago

It seems to work perfectly in your demo, could you provide a snippet for that click action? It seems great.

It is a small binary using the accessibility api to click the items. I will share it once my new setup is completed. It also works with the right side items.

@FelixKratz how do I use multiple aliases for the same app? I want to use some raycast menu bar items but I do not know how to specify which one must use which.

You can specify which item of the app you want to alias, they usually have different names. See the output of sketchybar --query default_menu_items for info about all available items.

FormalSnake commented 9 months ago

Thank you!