It is possible to refresh Spaceman using the following Apple Script command:
tell application "Spaceman" to refreshWhen using yabai, you can make sure that the icons stay up to date with the following code added to the end of yabairc:
signals=(
"space_changed"
"display_added"
"display_removed"
"display_moved"
"display_changed"
"mission_control_enter"
"mission_control_exit"
"space_created"
"space_destroyed"
)
for signal in "${signals[@]}"
do
yabai --message signal \
--add \
event=$signal \
action="osascript -e 'tell application \"Spaceman\" to refresh'"
done