Repository navigation
Fit the presentation terminal to its logo instead of a fixed 875x600 - #9281
londospark wants to merge 11 commits into
Conversation
The branded floating terminal used for installs, wifi setup, fingerprint setup, and updates opens at a hardcoded 875x600px, sized for the default terminal font. At a bumped `omarchy display text-size` the window is no longer wide enough for the 81-column logo, which wraps mid-glyph into an unreadable mess. The size that hugs the logo depends on the terminal font, so it can only be measured from inside the terminal -- the same approach omarchy-launch-about uses for its own window. Column target comes from the logo's real width; row target preserves the old 875x600 rule's own aspect ratio at whatever width the logo needs, rather than a flat row count that would leave the window a different shape than before. The window is matched by walking this process's own ancestry rather than `hyprctl activewindow`, since the popup isn't guaranteed to hold focus and activewindow silently matches nothing (skipping the fit) when it doesn't.
own_client() only matched a client whose pid was in this script's own process ancestry, which never finds the window when the terminal runs as a persistent server (e.g. `foot --server`) -- the process that maps the window there isn't a descendant of this script. Since org.omarchy.terminal is exclusive to this launcher, fall back to the sole client of that class when the ancestry walk finds nothing, and stay silent when that's still ambiguous (more than one match). fit_window() divided by a window height that could read as 0 in the brief window before Hyprland finishes populating a just-mapped client's geometry, silently driving a bad resize; guard it the same way the nudge loop already guards its own read. The window-rule cache (presize_window/apply_size_rule/remember_fit) was confirmed in the PR description to have no effect on the size a window opens at, so drop it rather than ship it as dead weight next to the live nudge that actually works. own_client()'s ancestry walk is a real ps/hyprctl round trip per ancestor; fit_window() called it before the loop and again on every nudge. Resolve the client once and read updated geometry through a plain by-address lookup for the rest of the fit. The --render branch relied on `exec` to make the rest of the file unreachable instead of an explicit if/else, against this repo's convention for two-path control flow. A stray quoted variable in a numeric [[ ]] comparison is fixed to match it too. Extends test/shell.d/floating-terminal-test.sh to cover the fallback match, the ambiguous-refusal case, the height-0 guard, the dropped cache, and that the client is resolved once per fit.
settle_grid() and hypr_dispatch() were byte-for-byte copy-pasted from omarchy-launch-about into the presentation launcher's own review round. Move them into a shared, sourced helper now that both callers need exactly the same behavior, so a future change to the resize/settle mechanism only has to happen once.
|
@dhh @ryanrhughes — this PR fixes the presentation terminal window sizing issue and makes it responsive to What changed:
Testing: passes all tests; manually verified at default and bumped text sizes. Would love to get this into quattro — any feedback or concerns? |
|
The user reported a broken logo in the Spotify install popup while it waited for a sudo password. Their screenshot shows the logo wrapped across lines above the password prompt. I reproduced the logo problem on Omarchy omarchy-launch-floating-terminal-with-presentation 'sleep 2; stty size; sleep 10'The live terminal reported This confirms the reported logo problem with these settings. I have not installed or tested the change in this PR. |
quattro now passes the presented command's exit status to omarchy-show-done so a failure shows as Failed rather than Done. The render branch keeps that, so the fit does not undo it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fit grows the window to whatever width the logo needs at the current font, and nothing bounded that by the screen. With Ghostty at text size 18 on a 1280x800 display it asked for 1500x1033 and Hyprland centred it at -110,-97, past every edge, cutting off the logo it was sized for. Cap the resize to the monitor's logical size less the bar's reserved area, and stop nudging once the window is already as large as that allows: a font too big for the logo to fit on this screen still wraps it, inside a window the user can see. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed and run on a disposable Omarchy worker (1280x800, scale 1), in foot and in Ghostty. The bug is real and this fixes it. I pushed two commits to the branch; the size of the change and its effect at the default text size are questions for the maintainer. Reproduction. On Pushed:
Tests on the worker at 0bcf463: For the maintainer:
Second opinion: none. The configured reviewer (Codex Medium) answered its availability check, but Waiting on the maintainer. |
[Medium impact] The change reaches many tasks that open the presentation terminal. The PR should not merge until the three outstanding window-selection and fitting problems are addressed. Findings
SummaryThe PR measures the presentation terminal before drawing its logo.
No new findings were accepted. Reviews (5) · Last reviewed commit: "Drop the check that removed functions st..." · Reviewed by Greptile |
| (( target_w == width && target_h == height )) && return 1 | ||
|
|
||
| hypr_dispatch "hl.dsp.window.resize({ window = \"address:$address\", x = $target_w, y = $target_h })" resizewindowpixel "exact $target_w $target_h,address:$address" | ||
| hypr_dispatch "hl.dsp.window.center({ window = \"address:$address\" })" centerwindow |
There was a problem hiding this comment.
Fallback centers another window When the Lua centering command fails,
centerwindow runs without the terminal's address. If the presentation terminal has lost focus, the fallback centers whichever window is focused instead, moving an unrelated window. Pass the resolved address to the fallback.
| hypr_dispatch "hl.dsp.window.center({ window = \"address:$address\" })" centerwindow | |
| hypr_dispatch "hl.dsp.window.center({ window = \"address:$address\" })" centerwindow "address:$address" |
| local rows cols | ||
| read -r rows cols <<<"$(stty size)" | ||
| [[ -n ${cols:-} && -n ${width:-} ]] || return 1 | ||
| (( height > 0 )) || return 1 |
There was a problem hiding this comment.
| match=$(hyprctl clients -j | jq -r --arg id "$APP_ID" \ | ||
| '[.[] | select(.class == $id)] | if length == 1 then .[0] | "\(.address) \(.size[0]) \(.size[1])" else empty end') | ||
| [[ -n $match ]] && { printf '%s\n' "$match"; return 0; } |
There was a problem hiding this comment.
Concurrent server windows remain unfitted If the terminal runs through a persistent server, its window-owning PID is not in this process's ancestry. With two presentation terminals open, the fallback also rejects both because they share the same class. The second terminal is never fitted, so its logo can wrap at larger text sizes.
|
Greptile's three findings at 0bcf463, checked against the source. None of them is a case where this branch does worse than
None of these needs code added to the branch. The open question is still the earlier one: about 300 lines, plus a smaller window at the default text size, against a fix that only grows the window when the logo doesn't fit. Second opinion: none again. Codex Medium answered its availability check, but Waiting on the maintainer. |
… class A terminal running as one process for many windows (foot's server, Ghostty in single-instance mode) maps every org.omarchy.terminal window from that process, and the menu's package install, AUR install and package remove entries open that class too. The ancestry walk took the first client matching the pid, so with one of those open it could resize and centre the installer while the presentation window stayed at 875x600. Treat a shared pid as ambiguous, as the fallback already treats several unmatched clients, and correct the fallback's comment, which called the class exclusive to this launcher. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The second opinion has now run on this pull request. It found one real defect, which I fixed and pushed as 6cef930. The question for the maintainer is unchanged. Pushed: 6cef930 stops the fit resizing a window that is not its own. Re-run on a disposable Omarchy worker at 6cef930 (foot, 1280x800):
@johnpippett's run at scale 1.25 above, where the logo went from 63 columns to 84, matches what the worker shows. Second opinion (Codex Medium). On 0bcf463 it found the shared-pid issue above, which neither earlier review had reasoned about. On the fix it found nothing wrong. It also confirmed that the For the maintainer, as before: the window now fits the logo at every size, but it also shrinks at the default text size, from 875x600 to about 630x420, with ten fewer rows for update and install output. The change is about 300 lines. Growing the window only when the logo does not fit, or having Reviewed by Claude Opus 5.5 and Codex Medium. Waiting on the maintainer. |
The fit measured the logo and nudged the window to hug it in both directions, so a terminal that already drew the logo whole still shrank: 875x600 down to about 630x420 at the default text size, ten rows of install and update output gone for a logo that needed none of it. The terminal's own grid answers the only question the fit exists to ask, and it answers it before any window has to be found. Read the grid first and return untouched when the logo already draws whole, so only a wrapping logo costs a resize and that resize can only grow the window. The zero-height case now carries its monitor so it reaches the guard it names, and proves the refusal through the dispatch log and stderr: a return code alone also reads as a refusal from a fit that ran out of nudges.
|
Pushed Reading it back, the shrink was a regression I introduced for no benefit — the fit exists to stop the logo wrapping, not to hug it. It now reads the terminal's own grid first and returns without touching any window when the logo already draws whole. Where the logo fits the float rule's 875x600, the window is left exactly at 875x600, with the rows of install and update output intact; only a wrapping logo costs a resize, and that resize can only grow the window from the box it was given. It also means no hyprctl/ps work in the common case, since the window is never even looked up. Verified at the default text size on my own session (Ghostty 1.3.1, checkout's launcher confirmed in the probe): the popup comes up 992x670, 29x86, logo on one line, inside the monitor. On this font 875px is only about 76 columns, so this window needed the growth — the fix is doing the work at the default size here rather than only at bumped ones.
What's left is the size of the change: the shared resize helper plus the Also merged today's |
The row target takes the old 875x600 float's shape at the width the logo needs, so a window that opened taller than that shape -- a user's own float rule, say 875x800 with 30 rows -- was asked for 25 rows and lost five while it grew wider. Floor the row target at the rows the window already has, so the fit only ever grows it, as the launcher's comment says. Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re-reviewed at 7c805fb and the merge of Reproduction at the new head, with
Pushed: ae562ab keeps a tall window's rows. The row target uses the old 875x600 shape at the width the logo needs, so a window that opened taller than that shape could lose rows while the fit widened it. With a float rule of 875x800, 30 rows and 77 columns, the fit asked for 25 rows. The row target now never goes below the rows the window already has, so the fit only ever grows it, as the launcher's comment says. A new case in Tests on the worker at ae562ab: Second opinion (Codex Medium). It found the row shrink above, which I had not reasoned about. On the fix it found nothing wrong. It also said that a monitor cap can make the window smaller than it opened, and that a terminal at 81 to 84 columns, which already draws the logo whole, is still widened to 85. I left both alone. The cap only shrinks a window that is already bigger than its monitor, so the cap is doing its job there. The widening only grows the window, by the padding the author chose. It found no problem in the Overlap: #13563 rewrites this launcher, and #12268 changes What is left is the size of the change. Most of it is tests, but it also adds a shared helper file and moves two functions out of |
quattro deleted test/shell.d/floating-terminal-test.sh in omacom#16334, and this branch adds the fit's tests to it. Keep the file with this branch's tests, minus the setsid launch check omacom#16334 removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It asserts functions no code defines are undefined, so it can only fail if someone adds them back under the same name. quattro's AGENTS.md rules out tests that restate the implementation, and omacom#16334 removed this kind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This had stopped merging after What I pushed:
Reproduction at bc1f53f on a disposable Omarchy worker (foot, 1280x800), with
Tests at bc1f53f: Second opinion: Codex Medium and muse-wonder (pi, high effort) reviewed the port and the whole diff against For you, @londospark: the description still says the fitted size is cached in Waiting on: the maintainer. The fix is verified, but how big it should be is their call: the new shared helper, the |
|
Updated the description to match the code at bc1f53f: the |


Disclosure: this fix was built with AI assistance (Claude Code) -- the investigation, implementation, and this description were largely vibe-coded. I reviewed and tested everything below on my own machine before opening this, but wanted to be upfront about how it was made.
Summary
The branded floating terminal used for installs, wifi setup, fingerprint setup, and updates (
omarchy-launch-floating-terminal-with-presentation) opens at a Hyprland float rule hardcoded to 875x600px (default/hypr/apps/system.lua, shared with the genericfloating-windowtag). That size is only wide enough for the 81-column logo at the default terminal font. At a bumpedomarchy display text-size, the window is too narrow and the logo wraps mid-glyph:Before:

After:

Why this needs measuring, not a rule
The size that fits the logo depends on the terminal's actual cell metrics, which can only be read from inside a running terminal -- the same constraint
omarchy-launch-aboutdocuments for its own window. I initially tried setting the size declaratively (both a statico.windowrule in Hyprland config, and ahl.window_ruleinjected viahyprctl evalimmediately before spawning, mirroringomarchy-launch-about'sapply_size_rule/presize_windowpattern). Neither affected the size a new window actually opens at, in any ordering or timing I tried. The only thing that reliably resizes the window is an imperative resize dispatched after it exists, so that's what this does, self-relaunching with--renderthe same wayomarchy-launch-aboutdoes.What's sized, and how
wc -Lonlogo.txt) plus a little padding. Not hardcoded, so a rebranded logo is measured correctly.~/.local/state/omarchy/windows/presentation.fitand re-applied it throughpresize_window/apply_size_rule, likeomarchy-launch-about, but a rule set that way never changed the size a window opens at, so the cache was dropped. The live nudge runs on every launch.omarchy-launch-aboutthrough a newomarchy-hyprland-window-resize-helpers, so both windows use the same plumbing.A bug caught along the way
The window is matched via a small
own_client()helper that walks this process's own ancestry ($$up throughps -o ppid=) to the Hyprland client Hyprland reports for this class, rather thanhyprctl activewindow. I triedactivewindowfirst, matchingomarchy-launch-about's pattern, but it silently returns nothing -- skipping the fit entirely -- whenever the popup doesn't hold focus, which happens whenever something else grabs focus while the terminal is still spawning. Caught this because a stray terminal from earlier testing had focus during a re-run and the fit didn't apply at all.Testing
bash -n bin/omarchy-launch-floating-terminal-with-presentationtest/shell.d/floating-terminal-test.sh-- passes./test/all-- no new failures (4 pre-existing failures unrelated to this file:bar-icon-geometry-test.sh,config-test.sh,snapper-test.sh,unowned-system-paths-test.sh; confirmed these fail identically on a cleanquattrocheckout)omarchy display text-size 14): logo renders cleanly at both, final window shape matches the old box's aspect ratio (~1.48 vs. the original 875x600's 1.46), and the fit still applies correctly when the popup doesn't have focus (the bug described above)Note on scope
I run a small local Quickshell plugin as a stopgap on my own machine (external to this repo, since I can't presize the window without this fix) -- not part of this PR, just flagging that I've been dogfooding the underlying behavior beyond this one script for a while.