Skip to content

Fit screensaver art to the monitor scale - #7307

Open
vitalibondar wants to merge 6 commits into
omacom:quattrofrom
vitalibondar:screensaver-fit-art-to-scale
Open

vitalibondar wants to merge 6 commits into
omacom:quattrofrom
vitalibondar:screensaver-fit-art-to-scale

Conversation

@vitalibondar

@vitalibondar vitalibondar commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem

ttfx does not scale its input art — it renders it into whatever canvas the terminal provides. omarchy-launch-screensaver hardcodes an 18 pt font, so the number of rows available depends entirely on the monitor scale. Once the art no longer fits, it is silently cropped: the top and bottom of the logo simply fall off the screen, with no warning.

Concrete numbers from a 1920x1080 panel at scale 1.6:

rows
available in the terminal at 18 pt 21
stock branded art 26
lost off screen 5

An 18 pt JetBrains Mono Nerd Font cell is ~14.4x31.68 px, so the usable row count is (height / scale) / 31.68. The crop starts at roughly scale 1.3 and gets worse from there.

This is easy to miss because it looks like a broken image rather than a layout problem, and the people most likely to hit it are those who raise the display scale for accessibility reasons — for whom "just lower the scale" is not a workaround.

Change

Measure the art once and derive the font size per monitor:

by_height = (height / scale) / ((rows + 1) * 1.76)
by_width  = (width  / scale) / ((cols + 1) * 0.8)
font_size = min(by_height, by_width)

The 0.8 and 1.76 factors are the JetBrains Mono cell aspect expressed relative to font size (verified against the 14.4x31.68 px cell at 18 pt). One spare row and column keep the art off the very edge.

Notes on the implementation:

  • The size is capped at the current 18 pt. Anything that renders correctly today keeps rendering identically — the size only ever shrinks, and only when the art would otherwise be cropped. Nothing changes for users at scale 1.0.
  • Monitor rotation is handled — a transform of 1/3/5/7 swaps the logical sides.
  • Per monitor, not per session, since the existing loop already walks every monitor and scales can differ between them.
  • A user-provided art file takes precedence. ~/.config/omarchy/branding/screensaver.txt is measured if present, so a custom logo gets the same treatment as the stock one.
  • Falls back to 18 pt whenever the art or the monitor geometry cannot be read.

All four supported terminals accept the size on the command line, so no config files needed to change.

Testing

Tested on foot at scales 1.0, 1.25, 1.5, 1.6, 1.75, 2.0 and 2.5 with a 26-row custom logo: the art fits at every step, and at 1.0 and 1.25 the resulting size is still the stock 18 pt.

Fixes #9027

ttfx does not scale its input art -- it renders it into whatever canvas the
terminal provides. Because the launcher hardcodes an 18 pt font, the number
of rows available depends on the monitor scale, and the branded art is
silently cropped once it no longer fits.

On a 1920x1080 panel at scale 1.6, an 18 pt JetBrains Mono cell leaves 21
rows while the stock art is 26 rows tall: five rows are lost off the top and
bottom of the logo. Users who raise the scale for accessibility reasons hit
this immediately, and lowering the scale is not an acceptable workaround.

Measure the art and derive the font size per monitor instead. The size is
capped at the current 18 pt, so anything that fits today keeps rendering
exactly as before; it only shrinks when the art would otherwise be cut off.
Monitor rotation is taken into account, and a user-provided art file in
~/.config/omarchy/branding takes precedence over the stock one.

Verified on foot at scales 1.0 through 2.5 -- the art fits at every step.
Copilot AI balanced review requested due to automatic review settings August 17, 2026 18:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@xPsycho999

Copy link
Copy Markdown

Tested this branch's omarchy-launch-screensaver on Omarchy 4.0.4. The PR's base launcher is identical to the 4.0.4 one. The setup has three monitors and Ghostty as the terminal. The screensaver art is the default 81-column wordmark.

Monitor quattro This PR
1920x1080, scale 1, transform = 1 (portrait, 1080 px wide) --font-size=18, the wordmark is cut off at both edges ("MARCH" plus parts of O and Y) --font-size=16, the full wordmark shows
2560x1440, scale 1 18 18
1920x1080, scale 1 18 18

So the transform swap covers the portrait case that was raised on #9045. One detail: on the portrait monitor at 16, the wordmark spans x = 26 to 1079 of 1080 px. That leaves about 1 px on the right, against 26 px on the left. It fits, but with almost no margin. A slightly larger cell-width factor than 0.8 (or cols + 2) would leave some room on both sides.

Ghostty draws the JetBrains Mono cell slightly wider than 0.8x the font
size, so on a 1080 px wide portrait monitor the 81-column wordmark fit
with about 1 px to spare. Use 0.82 and two spare columns: that monitor
now gets 15 pt instead of 16, everything else is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011N1mzAKJygEkcHAHV1776r
@vitalibondar

Copy link
Copy Markdown
Contributor Author

Thanks for testing this on a portrait setup, that's the case I couldn't check myself.

You're right about the margin. Your numbers also show that Ghostty draws the cell a bit wider than foot: 81 columns over 1053 px at 16 pt is about 0.81x the font size, not 0.8x. On its own, cols + 2 wouldn't have changed anything there, since the size still rounds down to 16. So I pushed both: 0.82 for the width and two spare columns. With that, your portrait monitor gets 15 pt and both landscape ones stay at 18. The 1.6 scale case from the description is still 14.

@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

The screensaver now chooses a font size for each monitor from the art dimensions, display scale, and rotation.

  • Screensaver art gets a font size that fits each monitor.

No new actionable issues were found.

Reviews (3) · Last reviewed commit: "Count the art's columns as characters in..." · Reviewed by Greptile

Comment thread bin/omarchy-launch-screensaver Resolved
wc -l counts newline characters, so an art file that does not end with
a newline loses its last row, and a one-line logo gets zero rows. With
zero rows the launcher skips fitting and falls back to 18 pt, so a wide
one-line logo stays cropped. awk's NR counts the last line either way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011N1mzAKJygEkcHAHV1776r
@omarchybot omarchybot added bug Something isn't working and removed enhancement New feature or request labels Oct 13, 2026
omarchybot and others added 3 commits October 13, 2026 10:13
omarchy-screensaver always passes ~/.config/omarchy/branding/screensaver.txt to ttfx. The two fallbacks under $OMARCHY_PATH do not exist in the repository, and if they did, the font would be sized for art that is not on screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stock logo is drawn in three-byte block characters. Under a non-UTF-8 locale awk's length() counts bytes, so the 81-column logo measured 197 and the font shrank to 6pt on a 1080p monitor at scale 2, and to 11pt even at scale 1. The test runs the launcher under LC_ALL=C on a scale-1 and a scale-2 monitor and checks the size each gets.

Co-Authored-By: Omarchybot <317366263+omarchybot@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 13, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and verified at 85dcbb9. I classified this as a bug fix rather than an enhancement: on a stock install, Hyprland's "auto" scale picks 2 for a 1080p laptop panel, and at 18pt the logo is cropped (#9027).

What was run, on a disposable Omarchy ISO VM with foot as the terminal and a 1280x800 display:

  • At scale 2, quattro starts foot at 18pt and its fullscreen grid is 12 rows by 44 columns, so the 81x10 logo loses nearly half its width. This branch starts it at 9pt and the grid is 24 by 91, so the whole logo fits. At scale 1 it stays at 18pt.
  • A new check in test/shell.d/screensaver-workspace-test.sh gives the launcher a 2560x1440 monitor at scale 1 and a 1920x1080 monitor at scale 2. It expects 18 and 14 and fails on quattro.
  • ./test/cli passes. ./test/shell has 6 failures, and the same 6 fail on quattro itself on that machine, so none come from this change. They still keep it from being marked ready.

Pushed to this branch:

  • quattro merged in. It went in without conflicts, so the launcher is verified as it would land, including the per-monitor special workspaces.
  • The art is now measured only at ~/.config/omarchy/branding/screensaver.txt, the file omarchy-screensaver hands to ttfx. The two $OMARCHY_PATH fallbacks do not exist in the repository, and measuring them would size the font for art that is not on screen.
  • The column count now runs under LC_ALL=C.UTF-8. The logo's block characters are three bytes each, so outside a UTF-8 locale awk counted 197 columns instead of 81. The new test runs under LC_ALL=C to cover it. That guard comes from Shrink the screensaver font so the logo fits on a 1080p panel at scale 2 #14702.

Competing fix: #14702 fixes the same bug the same way. This one was first, and on the stock logo both pick the same size, so this is the one brought forward. Its locale handling is folded in above.

Second opinion: Codex Medium reviewed the diff over two rounds and found nothing blocking at this head; its agreement may not be fully independent of my review. It also pointed out a limit in both pull requests. Custom art that contains tab characters is measured as narrower than ttfx draws it, because ttfx expands tabs to four-column stops. Neither the stock logo nor omarchy-transcode-ascii produces tabs, so I left it as is. On the question of which fix to bring forward, it preferred #14702 because of that tab case, where #14702 shrinks the font too far rather than cropping. Both get tabs wrong, so I kept the older one.

This fixes #9027. #15253 looks like something else: at 2560x1600 and scale 2 this branch keeps 18pt, which fits 88 columns, so a 54-column grid there points at something other than font size.

Waiting on the maintainer.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

@vitalibondar, this now conflicts with quattro, and the reason is that the code it changes is gone. fdbe182 replaced the terminal screensaver with the native Wayland one from the omarchy-screensaver package, and 8ac025e removed the last of the wrapper. bin/omarchy-launch-screensaver on quattro is now one line that runs /usr/lib/omarchy-screensaver/omarchy-screensaver. The terminal configs, the per-terminal font flags this sets, and test/shell.d/screensaver-workspace-test.sh were all deleted, so there is nothing on quattro to port this onto. I did not merge quattro in or run anything this time.

#9027 probably still happens with the native screensaver. I worked this out from the source of omarchy-screensaver v1.3.1, the version omarchy-pkgs ships, and did not run it. It draws a fixed 24px font (src/raster.rs:8), and with JetBrains Mono each cell is 14×32 logical pixels. A 1920×1080 output at scale 2 gives 68 columns by 16 rows (grid_size, src/raster.rs:60). The 81-column logo that quattro copies to ~/.config/omarchy/branding/screensaver.txt is wider than that, and nothing in the package measures the art or shrinks the font to fit it. The fit-to-art calculation here, and its 1080p at scale 2 case, is what a fix in omacom/omarchy-screensaver would need.

#14702 takes the same terminal-based approach, so fdbe182d3 leaves it behind in the same way.

Second opinion: Codex Medium and muse-wonder (pi, high thinking) both checked these points. Both found that nothing in this PR applies to quattro. Both got the 68×16 grid, from the installed font's metrics and from the package's own benchmark. Both found no fit-to-art logic in the native renderer. Their agreement may not be fully independent of my review. muse-wonder also checked whether the launcher could still help through --cols/--rows. It cannot: those only resize the ttfx canvas, and the cell size stays fixed.

Waiting on the maintainer. My recommendation is to close this as superseded by the native screensaver and to track the remaining clipping against omarchy-screensaver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Screensaver wordmark clipped horizontally at default monitor scale on 1080p displays

4 participants