Repository navigation
fix: size screensaver font to fit the branding art on any display - #15359
dontexpectmetousethis wants to merge 1 commit into
Conversation
The screensaver launches at a hardcoded font size of 18. The branding art is 81 columns wide, but a display whose logical width fits fewer columns than that clips the art: on a 2256x1504 panel at 2x scale, size 18 fits only 77 columns, so the last letters of OMARCHY run off the right edge (and with centered anchoring, off the left too). Compute a font size per monitor from its logical width instead, using the art's actual column count from the branding file. Cell width for the monospace fonts these configs use is ~0.8x the font size, so font_size = logical_width / (0.8 * art_columns) sizes the art to fit exactly. The result is clamped to [12, 18] so large displays keep the stock size and tiny ones stay legible. Each terminal gets the size through its native override (foot -o, alacritty -o, ghostty --font-size, kitty --override). Measured on a Framework 13 (2256x1504 @ 2x): size 18 -> 77 columns (art clipped on both edges), computed size 17 -> 83 columns, art fits with 85px/52px margins at the left/right screen edges.
|
Thanks for the careful write-up and the measurements. The bug is real: at a fixed 18pt the 81-column logo needs about 1166 logical pixels, so any display narrower than that crops it, and your Framework 13 at 2x (1128 wide) is one of them. There is an older open pull request for the same bug, #14702 (opened 2026-10-09, by this bot account), which takes the same approach: a font size per monitor from its logical size, capped at 18, passed to each terminal on the command line. Where the two differ, #14702 covers cases this one does not:
So by the rule we follow for competing fixes (the older one wins unless the newer is clearly better), #14702 is the one being taken forward, and this one was not run on a worker. I found nothing here that #14702 lacks. The second opinion suggested adopting the fallback to 18 when Checked by reading both diffs against |
Problem
The screensaver clips the branding art on displays whose logical width fits
fewer columns than the art is wide.
omarchy-launch-screensaverstarts every terminal at a hardcoded font sizeof 18. The branding art (
~/.config/omarchy/branding/screensaver.txt) is 81columns wide. On a display whose logical width fits fewer columns than that at
size 18, the art overflows: on a Framework Laptop 13 (2256x1504 at 2x scale =
1128x752 logical), size 18 fits only 77 columns, so the last letters run off
the right edge — and because ttfx anchors the canvas centered, part of the
first letter goes off the left edge too. The word is unusable until
fullscreened.
Fix
Compute the font size per monitor from its logical width, instead of
hardcoding 18:
Cell width for the monospace fonts these configs use is ~0.8x the font size,
so
font_size = logical_width / (0.8 * art_columns)sizes the art to fitthe display exactly. The art's column count is read from the branding file,
so a custom
screensaver.txtgets the same treatment.The size is clamped to
[12, 18]:size — zero visual change for them
Each terminal receives the size through its native override mechanism:
foot
-o "font=...:size=N", alacritty-o "font.size=N",ghostty
--font-size=N, kitty--override font_size=N.Measurements
On a Framework Laptop 13 (12th Gen Intel, 2256x1504 @ 2x scale, foot,
JetBrainsMono Nerd Font):
The formula was validated against three empirical data points
(18→77, 17→83, 16→86 columns) before being written.
Since the size is derived per monitor from
hyprctl monitors, mixed-DPImulti-monitor setups get a correct size on each display, and the value
follows resolution/scale changes.