Skip to content

Trick — Trigger refreshes using yabai -m signal #110

@devnoname120

Description

@devnoname120

Using yabai's signals is more reliable than Hammerspoon, as the latter uses some deprecated macOS APIs, some of which don't work anymore (see #113).

This can be fixed by adding the following code to ~/.config/yabai/yabairc:

# See https://github.com/koekeishiya/yabai/blob/master/doc/yabai.asciidoc#673-event
EVENT_TYPES=(
    display_added
    display_removed
    display_changed
    space_changed
    application_visible
    application_hidden
    window_created
    window_destroyed
)

for event in ${EVENT_TYPES[@]}; do
    yabai -m signal --add event=$event action="hs -A -c 'stackline.manager:update({forceRedraw = true})'"
done

Edit: looks like it can quickly cause stackline or Hammerspoon to crash, probably due to race conditions and duplicated event handling (yabai's signals defined above + stackline event callbacks registered in Hammerspoon).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions