From e1fc50228605cb7d899b7778a8106b5beed0da7f Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 30 Aug 2026 16:06:16 -0400 Subject: [PATCH] Nudge the bar over IPC when toggling visibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- bin/omarchy-toggle-bar | 6 ++++++ shell/plugins/bar/Bar.qml | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/bin/omarchy-toggle-bar b/bin/omarchy-toggle-bar index f76fe049..be18a647 100755 --- a/bin/omarchy-toggle-bar +++ b/bin/omarchy-toggle-bar @@ -5,3 +5,9 @@ # 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 diff --git a/shell/plugins/bar/Bar.qml b/shell/plugins/bar/Bar.qml index 9e736b3f..def615af 100644 --- a/shell/plugins/bar/Bar.qml +++ b/shell/plugins/bar/Bar.qml @@ -948,6 +948,21 @@ Item { onFileChanged: barHiddenProbe.running = true } + // The directory watch can permanently stop delivering events after flag + // changes land in quick succession, stranding the bar off screen until the + // shell restarts. `omarchy-toggle-bar` nudges this after flipping the flag + // so the probe re-reads it even when the watch has gone quiet. + IpcHandler { + target: "omarchy.bar" + + // Start rather than restart: a probe already in flight was launched by the + // directory watch after the flag flipped, so its answer is current, and + // killing it here can swallow the result entirely. + function syncHidden(): void { + barHiddenProbe.running = true + } + } + Variants { model: Quickshell.screens