omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

omarchy toggle bar on/off has inverted semantics (hides bar on 'on', shows it on 'off')

Open Amvurguezo opened this issue 3 months ago • 3 comments

What happened

Running omarchy toggle bar on hides the top bar, and omarchy toggle bar off shows it — the exact opposite of what the command name and its own documented examples imply.

Root cause: omarchy-toggle-bar forwards the raw on/off argument straight through to the underlying bar-off flag without inverting it:

$ cat $(which omarchy-toggle-bar)
#!/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}"

Since the underlying flag is named bar-off (true = bar is hidden), passing on sets bar-off to enabled (bar hidden), and passing off disables bar-off (bar shown). The wrapper needs to invert the action before forwarding it to the bar-off flag, e.g. map on -> off and off -> on (and leave toggle as-is).

How I found it / reproduction

  1. On a fresh boot the top bar wasn't rendering at all, even though the omarchy-shell (quickshell) process was alive.
  2. hyprctl layers showed the omarchy-bar layer surface existing but positioned off-screen: xywh: 1920 -26 1920 26 (26px above the visible monitor area, i.e. in its hidden position).
  3. omarchy toggle enabled bar-off returned exit code 0, confirming the bar-off flag was active (bar hidden).
  4. Ran omarchy toggle bar on expecting it to show the bar — instead omarchy toggle enabled bar-off still returned 0 (still hidden), and the layer stayed at y: -26.
  5. Ran omarchy toggle bar off instead — the bar-off flag was cleared (omarchy toggle enabled bar-off now returns exit 1), and hyprctl layers immediately showed the bar back at xywh: 1920 0 1920 26 (visible).

So functionally:

  • omarchy toggle bar on → bar hidden
  • omarchy toggle bar off → bar shown

Expected

  • omarchy toggle bar on → bar visible
  • omarchy toggle bar off → bar hidden

matching the command's own summary/examples ("Toggle bar visibility... omarchy toggle bar off | omarchy toggle bar on").

System details

  • Omarchy version: 4.0.0-1
  • Compositor: Hyprland (single laptop panel monitor, eDP-1, active at the time of testing)
  • omarchy debug is not an available command on this version (omarchy commands --all has no debug entry), so I couldn't attach the standard diagnostic log.

Suggested fix

In omarchy-toggle-bar (or wherever it lives in the source tree), invert the action before forwarding to the bar-off flag, e.g.:

#!/bin/bash
case "${1:-toggle}" in
  on) omarchy-toggle bar-off off ;;
  off) omarchy-toggle bar-off on ;;
  *) omarchy-toggle bar-off toggle ;;
esac

Happy to open a PR with this fix if useful.

Amvurguezo avatar Aug 15 '26 19:08 Amvurguezo

Independently hit this on 4.0.0-1 today and arrived at the same root cause, so this is a confirmation rather than a new angle. Two details that might be worth folding in, since they're what turns the inversion from a naming wart into something that actively misleads:

The hidden state is persistent, not runtime. The flag lives at ~/.local/state/omarchy/toggles/bar-off, so a hidden bar survives a reboot. That produces this sequence:

  1. User hides the bar (in my case accidentally — SUPER+SHIFT+SPACE is bound to "Toggle top bar" in default/hypr/bindings/utilities.lua:16, immediately beside the SUPER+SPACE launcher).
  2. They reboot. The bar is still hidden, so it reads as "the reboot broke my bar" rather than "I hid it."
  3. They reach for the intuitive fix — omarchy toggle bar on — which re-hides it, appearing to confirm the bar is broken rather than hidden.

So the inversion is most likely to be encountered precisely when the user is already confused about why the bar is missing, and it reinforces the wrong conclusion. Worth noting omarchy toggle bar with no verb is unaffected and does the right thing — only the explicit on/off verbs invert.

Minor discoverability note: since Omarchy 4.x dropped Waybar, a user debugging this will find no waybar process and may conclude the bar isn't running. The tell that it's hidden rather than crashed is that hyprctl layers still shows the omarchy-bar layer, parked exactly one bar-height above the monitor's top edge, with reserved: 0 0 0 0 in hyprctl monitors — which matches the y: -26 you observed.

The on -> off / off -> on mapping you proposed in the wrapper looks like the right fix.

Cloud-Ops-Dev avatar Aug 24 '26 21:08 Cloud-Ops-Dev

Two open PRs address this exact inverted bar-toggle behavior. PR #9455 fixes the mapping and updates both shell and acceptance coverage. PR #9102 is a narrower implementation in the same wrapper. Each PR currently names a different duplicate report, so linking both alternatives here.

rookepoole avatar Sep 01 '26 09:09 rookepoole

Confirmed in source on current quattro (902fd8a): bin/omarchy-toggle-bar passes on/off straight to omarchy-toggle bar-off, and the shell hides the bar whenever the bar-off flag exists (shell/plugins/bar/Bar.qml), so omarchy toggle bar on hides the bar and off shows it. Running it with no argument, as the keybinding and the menu do, is unaffected.

One thing a wrapper-only fix would miss: omarchy-toggle-fullscreen-desktop forwards its own on/off to omarchy-toggle-bar and currently relies on the inversion to hide the bar when full screen goes on. #7023 inverts the mapping in the wrapper and updates that caller and both test suites, and it is marked to close this issue. It is being reviewed as its own item; #9102 and #9455, which made the same fix, were closed in its favour.

This diagnosis was checked against the source by Codex at medium effort, which reached the same mechanism and raised the full-screen caller; no reproduction was run for the issue itself, since #7023's review covers that. Waiting on the maintainer's decision on #7023.

omarchybot avatar Oct 08 '26 05:10 omarchybot