Run 1Password under XWayland at the display scale so its authorization prompt fits - #682
Open
brentkearney wants to merge 2 commits into
Open
brentkearney wants to merge 2 commits into
brentkearney wants to merge 2 commits into
Conversation
1Password's authorization prompt is a fixed-size window. As a native Wayland client its content outgrows it and the Authorize button is clipped; under XWayland the prompt grows to fit. With xwayland:force_zero_scaling the app scales itself to the focused monitor, otherwise Hyprland scales it and the factor stays 1.
App launchers and the onepassword:// URL handler start 1Password from its desktop entry, which on aarch64 is the tarball's own copy and bypasses omarchy-launch-1password. Install a per-user entry that passes %U to the launcher on fresh installs, on install, and through a migration for existing installs, and remove it with the app. Entries with custom commands or links are left alone.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #681
What changes
bin/omarchy-launch-1passwordstarts 1Password with--ozone-platform=x11 --force-device-scale-factor=<scale>and passes its own arguments through. It still opens the installer when 1Password is missing.default/applications/1password.desktopis a per-user desktop entry withExec=omarchy-launch-1password %U, so app launchers and theonepassword://URL handler take the same path as theSuper + Shift + /binding and the menu.install/user/1password.shinstalls that entry to~/.local/share/applications/. It runs during fresh user setup (1Password ships by default on Apple Silicon, and provisioning marks migrations complete), fromomarchy-install-service-1password, and from migration1790792558.shfor existing installs. It replaces entries that start 1Password directly (the tarball's own copy, or the copy whose executable was swapped for the/usr/local/bin/1passwordsoftware-GL wrapper) and leaves symlinks and entries with custom commands alone.omarchy-install-service-1passwordopens 1Password through the launcher after installing.omarchy-remove-service-1passwordremoves the launcher entry. A custom entry is left in place.How the scale is chosen
hyprctl getoption xwayland:force_zero_scalingreports it enabled (the fork default indefault/hypr/envs.lua), Hyprland doesn't scale X11 clients, so 1Password has to scale itself. The factor is the focused monitor's scale fromhyprctl monitors -j, passed through unrounded (for example2or1.666667).force_zero_scalingis off, Hyprland scales X11 clients itself, so the factor is1. A higher factor would be applied twice.hyprctlcan't answer, or returns no usable scale for the focused monitor, the factor is1. At factor 1 the prompt can look small on a HiDPI display, but its whole content fits in the window.DISPLAYis unset (XWayland disabled), 1Password starts natively on Wayland as before, since there is no X server to use.The launcher calls
1passwordfromPATH, so the software-GL wrapper at/usr/local/bin/1passwordstill adds its flags when there's no render GPU.Why a Mac-specific fix
--force-device-scale-factor=1in its launcher and in the x861passwordpackage's desktop entry. On aarch64 there's no package:omarchy-install-1passwordinstalls the official arm64 tarball, whose desktop entry has no flags, so the package pin never reaches Omarchy Mac. The fork's launcher has also diverged from upstream and passes no flags.text-scaling-factor1.1818), both were tried natively on Wayland:--force-device-scale-factor=1(upstream's launcher): the first view fits. Expanding the request details pushes the buttons below the window edge with no scrolling, and the window stays at 400x370.GSETTINGS_BACKEND=memory(omacom/omarchy#8575): same result. The first view fits, the expanded details push the buttons out of view, and the window stays at 400x370.--ozone-platform=x11 --force-device-scale-factor=2the main window was sharp and normal-sized. The prompt opened at 400x370 and grew to 400x459 when the details were expanded. The buttons stayed visible and Authorize worked.xwayland:force_zero_scaling = trueis the fork default, so XWayland renders clients at scale 1. The factor has to match the monitor scale, otherwise 1Password comes out tiny on a Retina display.ELECTRON_OZONE_PLATFORM_HINT=x11has no effect on this 1Password build. Only the--ozone-platform=x11command-line flag switches it, which is why the launcher and desktop entry pass flags instead of setting environment variables.Related upstream reports: omacom/omarchy#8574, omacom/omarchy#9904, omacom/omarchy#12228, omacom/omarchy#8575.
Related open PRs in this fork
quattrothrough #377. This PR builds on that work: the launcher calls the/usr/local/bin/1passwordwrapper, and the wrapper's desktop repair (omarchy-cmd-desktop-exec-repair) doesn't recognizeomarchy-launch-1passwordas an executable to rewrite, so it leaves the new entry alone. A test covers that interaction.bin/omarchy-install-1password, which this PR doesn't touch. #294 and #349 already conflict withquattro, and this branch adds no new conflicts.Known limitations
center = truewindow rule doesn't affect it. This PR doesn't fix that issue.~/.config/autostart/1password.desktop, and 1Password rewrites that file itself. Omarchy doesn't control that entry, so an autostarted 1Password still runs natively on Wayland, with the clipped prompt.Testing
Manual, on a MacBook running this fork: Hyprland 0.56.2 with the Lua config, 1Password 8.12.0 arm64 tarball, 3456x2234 display at scale 2, GNOME
text-scaling-factor1.1818,force_zero_scalingenabled.--ozone-platform=x11 --force-device-scale-factor=2: the prompt grows from 400x370 to 400x459 when the details are expanded. The buttons stay visible and Authorize works.2, and the launcher (withsetsidstubbed) builtuwsm-app -- 1password --ozone-platform=x11 --force-device-scale-factor=2 onepassword://x.desktop-file-validate default/applications/1password.desktoppasses.Automated:
test/shell.d/launch-1password-test.sh(8 checks): the focused monitor's scale is used when an unfocused monitor is listed first, fractional scales pass through, the factor is 1 whenforce_zero_scalingis off, whenhyprctlfails or when the scale is missing, 1Password starts natively withoutDISPLAY, URL arguments containing spaces pass through intact, and the installer still opens when 1Password is missing.test/shell.d/1password-desktop-test.sh(7 checks): the entry passes%Uto the launcher and claimsonepassword://. The migration does nothing without 1Password, installs the entry and is idempotent, replaces the tarball, wrapper and pinned entries, and preserves custom commands and symlinks. The software-GL desktop repair leaves the new entry untouched, and removal deletes only the launcher entry../test/all:test/clipasses.test/shellpasses 291 of 297 files. The 6 failing files fail identically on unmodifiedquattro: five need a siblingomarchy-pkgscheckout (config-test,arm-channel-staging-test,package-build-contract-test,settings-package-units-test,unowned-system-paths-test), andlaunch-about-test("a roomy window animates") depends on the live session.bin/omarchy commands --checkpasses (472 commands), and everybin/omarchy-*passes the syntax check.