FelixKratz / SketchyBar

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

Native Window Events #435

Closed FelixKratz closed 9 months ago

FelixKratz commented 9 months ago

Currently, window information and the respective events need to be acquired from the window manager program (e.g. yabai) to make displaying active windows/applications in the bar possible. I recently played around with some low level ways to be notified of the relevant events without resorting to accessibility permissions here: https://github.com/FelixKratz/JankyBorders

Specifically, I am thinking of a new event that is invoked when a user creates or closes a window on a specific space. I imagine the payload of the event being all currently open windows and their parent applications.

Possibly something like this: SENDER: space_windows_change INFO:

{
  "space": 1,
  "apps": {
    "Spotify": 1,
    "kitty": 2
  }
}

where the application names and their respective window counts for the space in question are listed.

This event would only work for macOS Ventura and up.