FelixKratz / SketchyBar

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

Using Control Center & Menu Bar Apps #576

Closed highjeans closed 3 months ago

highjeans commented 5 months ago

I recently found out about this project, and I really loved what could be done with this. However, I wanted to have a fully functional control center in SketchyBar, but I can't seem to find out how to do this.

I did add the BentoBox with --add alias "Control Centre,BentoBox" right, and while it does as the control centre icon, it doesn't open when I click on it.

In general, I cant find out how to use Menu Bar apps in general with SketchyBar. Adding its alias does nothing, and I can't seem to find a setting that would show its app/popup when it is clicked. Could anyone give some insight into this? Thanks!

maulik13 commented 4 months ago

You have to define a click_script and then program an action that you want to take. I believe the popup is only possible for items and not alias. I have tried doing a basic test for popup for alias, but it does not work.

Pe8er commented 4 months ago

This works for me:

click_script="osascript -e 'tell application \"System Events\" to tell process \"Control Center\" to perform action \"AXPress\" of menu bar item 2 of menu bar 1'"

FelixKratz commented 3 months ago

From a technical point-of-view it is no problem to open the popup of the actual item, see: https://github.com/FelixKratz/dotfiles/blob/master/.config/sketchybar/helpers/menus/menus.c The popup will however open at the location of the original item in the bar.