Automation
> Published on Wed, Feb 4, 2026> Updated on Wed, Feb 4, 2026
a-bar can be automated via AppleScript from the command line.
Refresh yabai data #
osascript -e 'tell application "a-bar" to refresh "yabai"'Refresh AeroSpace data #
osascript -e 'tell application "a-bar" to refresh "aerospace"'You can add this to your AeroSpace config (~/.aerospace.toml) to auto-refresh the bar on workspace and focus changes:
on-focus-changed = [
"exec-and-forget osascript -e 'tell application \"a-bar\" to refresh \"aerospace\"'",
]
exec-on-workspace-change = [
'/bin/zsh',
'-c',
'/usr/bin/osascript -e "tell application \"a-bar\" to refresh \"aerospace\""',
]Profiles #
osascript -e 'tell application "a-bar" to set profile "Work"'
osascript -e 'tell application "a-bar" to get profile'
osascript -e 'tell application "a-bar" to list profiles'Custom widgets #
osascript -e 'tell application "a-bar" to refresh "My Widget"'
osascript -e 'tell application "a-bar" to toggle "My Widget"'
osascript -e 'tell application "a-bar" to hide "My Widget"'
osascript -e 'tell application "a-bar" to show "My Widget"'