The shell notices the bar-off flag through a FileView watch on the toggles directory, and that watch can permanently stop delivering events after flag changes land in quick succession — the bar then stays parked off screen until the shell restarts. Have omarchy-toggle-bar nudge the bar's probe over IPC after flipping the flag, so the toggle no longer depends on the watch staying alive. The watch remains for other writers of the flag.
14 lines
549 B
Bash
Executable File
14 lines
549 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Toggle bar visibility without killing the Omarchy shell
|
|
# omarchy:args=[toggle|on|off]
|
|
# omarchy:examples=omarchy toggle bar | omarchy toggle bar off | omarchy toggle bar on
|
|
|
|
omarchy-toggle bar-off "${1:-toggle}"
|
|
|
|
# The shell's watch on the toggles directory can miss flag changes that land in
|
|
# quick succession, stranding the bar off screen until the shell restarts.
|
|
# Nudge the bar to re-read the flag; quiet best-effort so the toggle still
|
|
# works when the shell is not up.
|
|
omarchy-shell -q omarchy.bar syncHidden
|