-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
Add the following in ~/.config/yabai/yabairc:
yabai -m signal --add event=space_changed action="hs -A -c 'stackline.manager:update({forceRedraw = true})'"Optional — comment out these lines to avoid a double redraw:
stackline/stackline/stackline.lua
Lines 146 to 156 in 215b35d
| stackline.spaceWatcher = hs.spaces.watcher.new( -- {{{ | |
| function(spaceIdx) | |
| -- QUESTION: do I need to clean this up? If so, how? | |
| -- Update stackline when switching spaces | |
| -- NOTE: hs.spaces.watcher uses deprecated macos APIs, so this may break in an upcoming macos release | |
| log.i(('hs.spaces.watcher -> changed to space %d'):format(spaceIdx)) | |
| stackline.forceRedraw = true -- force the next update cycle to redraw | |
| stackline.queryWindowState:start() | |
| stackline:refreshClickTracker() | |
| end | |
| ):start() -- }}} |
Why: It may be because hs.spaces.watcher() is using a macOS API that is deprecated since macOS 10.8. It always returns -1 as a space id to the callback on newer macOS versions[1].
See Hammerspoon/hammerspoon#3250
See #110 for another performance trick.
[1] Confirmed on macOS Monterey 12.4.
Metadata
Metadata
Assignees
Labels
No labels