Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BarDisplay

Show or hide the Omarchy bar per display.

A bar-widget button + a popup that lists every monitor with a toggle, its resolution and refresh rate. Turning a display off hides the bar there; the bar always stays visible on at least one display. Works with the Shibumi bar and the default Omarchy bar.

BarDisplay: monitor list popup with per-display toggles, resolution and refresh rate

Install

omarchy plugin add https://github.com/Deoxizn/BarDisplay.git --enable

omarchy plugin add clones the repo, validates it, and enables the widget in the right section of the bar. Or drop the widget into bar.layout.right in ~/.config/omarchy/shell.json manually. The shell hot-reloads plugins and the bar.

Updating

omarchy plugin update dev.deoxizn.bardisplay

omarchy plugin update fetches the latest version, shows the diff, and asks before applying it. Run it without an id to update every installed git-managed plugin.

How it works

  • A headless service owns the state. The set of displays the bar appears on is stored in ~/.config/omarchy/shell.json under bar.monitors; an empty list means "every display" (the default, so nothing changes out of the box).
  • Toggling a display writes bar.monitors and pushes the list straight into the running bar, so panels appear/disappear without a restart.
  • Bar plugins have no native per-display toggle, so the service also runs scripts/ensure-bar-support.sh against the active bar's QML. That patch is idempotent (skips when already applied), backs the file up first, and refuses to touch the bar if its structure changed after an update — so it can't break the bar, it just re-applies the support when an update wipes it.
  • The default Omarchy bar lives in root-owned /usr/share/omarchy, so patching it needs a one-time admin grant. The panel shows an Apply button that runs the same script through pkexec; the support re-applies itself after updates (the panel will ask again).
  • System bars are not watched by Omarchy's plugin watcher (that only hot-reloads bars under ~/.config/omarchy/plugins), so the running built-in bar cannot read a freshly patched file. After a successful admin patch the panel confirms it (a desktop toast plus an 8-second countdown with a Cancel in the popup, in case pkexec's dialog stole the focus) and auto-restarts the shell via omarchy restart shell (Omarchy's own crash-free restart — not Quickshell.reload, which can crash quickshell-git). If the restart ever fails the panel keeps a manual Restart button.
  • The widget and its popup live in one Panel.qml entry point (like Omabench). The KeyboardPanel is a direct child of the widget root, which the Shibumi host relies on to anchor the popup to the visible bar edge and size it to the real content — don't wrap it in a Loader or inner Item.
  • Physical resolution and refresh rates come from hyprctl monitors -j (Hyprland), fetched once by the service at startup. Quickshell screens only report logical (scale-divided) pixels, so the physical width/height would otherwise read wrong on scaled displays.

Uninstall

omarchy plugin remove dev.deoxizn.bardisplay

Remove the widget from bar.layout in shell.json, and if you want to revert the bar itself, restore the backup the support script keeps next to the patched file (Bar.qml.bardisplay.bak).

Security

BarDisplay never modifies system files on the normal code path:

  • Shibumi bar: has native barMonitors support; the plugin only writes bar.monitors to ~/.config/omarchy/shell.json (user-owned).
  • Stock Omarchy bar: lives at /usr/share/omarchy/shell/plugins/bar/Bar.qml (root-owned). The one-time admin patch via pkexec is guarded by:
    • Symlink refusal — the script refuses to operate on symlinks for both the bar file and its backup.
    • Path allowlist — the elevated script only accepts the exact stock bar path (/usr/share/omarchy/shell/plugins/bar/Bar.qml); any other path is rejected.
    • Backup validation — the backup is verified to be a regular file in the same directory as the bar file.
    • TOCTOU re-check — the bar file is re-verified as a regular file immediately before the write, after the backup is created.
    • Self-healing on update — if the stock bar is updated and the patch is wiped, the service detects it and re-applies (the user is asked again).

Known issues

  • A one-time shell crash after the first install is a quickshell-git bug, not a BarDisplay problem. Quickshell.reload tears the IPC handler registry down in a way that can use-after-free (IpcHandler::updateRegistration, FileView) when a new engine generation is created — the reason Omarchy ships with Quickshell's own reloading disabled and reloads at the plugin level instead. BarDisplay used to call Quickshell.reload(false) to make the patched bar pick up its support; that reload was what crashed, so it has been removed in favor of Omarchy's plugin watcher, which re-creates user-owned bars the moment the patch writes their QML. For the built-in (system) bar — which the watcher does not cover — the service instead restarts the shell with Omarchy's own omarchy restart shell after a successful admin patch.
  • The bar patch is applied at shell startup from values computed fresh from the loaded manifests. Relying on QML bindings that read nested members of a property var (like manifest.__sourceDir) reads stale inside the host's change handlers and silently skips the patch; sourceDirFor() / activeBarFileFor() / supportScriptFor() avoid that.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages