kkga / nibar

Simple Übersicht status bar with yabai support.
MIT License
192 stars 33 forks source link

Performance of AppleScript Ubersicht refresh #2

Closed camspiers closed 3 months ago

camspiers commented 4 years ago

I found that the refresh of widgets via AppleScript was too slow. It turns out it was quite an effort to do it another way, but I came up with a solution that you might be interested in:

https://github.com/camspiers/dotfiles/tree/master/files/.config/ubersicht

New program to get active space changes from stdout:

https://github.com/camspiers/dotfiles/blob/master/files/.config/ubersicht/activespace.swift

Build step:

https://github.com/camspiers/dotfiles/blob/master/Makefile#L18

SSE server for delivering SSE's to Ubersicjt widgets:

https://github.com/camspiers/dotfiles/blob/master/files/.config/ubersicht/lib/activeSpaceServer.js

Subscription to it from a widget:

https://github.com/camspiers/dotfiles/blob/master/files/.config/ubersicht/left.jsx#L43