Files
Nomarchy/themes/kanagawa/rofi.rasi
Bernardo Magri 5aad3153ce
All checks were successful
Check / eval (push) Successful in 3m49s
fix(menu): #131 — size text menus in ch with a cap, not in % of the monitor
Bernardo saw Recovery ellipsize on a 2560x1440 external, which falsified
the item's model (40% + Inter 11 → "only below 1920"). Real cause: text
menus render through themes/<slug>/rofi.rasi, where boreal + neon-glass
pinned width: 620px (fixed — a wide panel buys nothing) while seven used
40%, and the font is whatever that file says — mostly monospace, far
wider than the Inter that was measured. The modelled combination ships in
no theme.

The insight: a menu must fit its longest label, which is a count of
characters in the THEME's font — so the window must scale with the font,
not the screen. 40% gives a 1366 panel 546px and a 2560 one 1024px for
the same row, and a 14pt mono theme needs ~25% more room than an 11pt one
on both; a percentage cannot see either fact.

Rofi has the right unit (`ch` = width of one digit in the current font)
and `calc( a min b )` to cap it, so every text menu — generated and all
nine whole-swaps — is now `width: calc( 84ch min 65% )`. 84ch fits the
longest row we ship (69 chars) plus icon and padding; the cap is
Bernardo's condition (never sprawl on a low-res panel) and it is
measured, not assumed.

Verified on hardware, not by arithmetic: 84ch = 756px in GeistMono 11 and
924px in JetBrainsMono 14; `calc( 84ch min 300px )` → 300px, so the clamp
really clamps. Screenshots at both ends — the real Recovery menu at 756px
(29% of 2560) with every label complete, and the Acer worst case
reproduced pixel-exactly (888px = 65% of 1366, JetBrainsMono 14) also
complete. Grid views override width per-invocation and are untouched.
checks.rofi-text-width guards the class, proven by pinning boreal back to
620px and watching it fail by name. Acer V3 queued for its own fontconfig.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-16 10:20:49 +01:00

114 lines
2.6 KiB
Plaintext

/**
* Nomarchy Kanagawa — rofi whole-swap (themes/<slug>/rofi.rasi).
* Ink-and-paper identity: a sumi-ink canvas inside a warm washi-paper frame
* (the same text-toned border the theme uses on windows — the only warm
* frame of the four), the inputbar a deeper ink well, and the crystal-blue
* wave reserved for the selected row. Soft rounding, an unhurried feel.
* The `configuration {}` block is omitted on purpose — modi/terminal/
* show-icons come from modules/home/rofi.nix.
*/
* {
sumi: #1f1f28; /* sumi ink — the canvas */
well: #090618; /* deeper ink — inputbar + zebra */
paper: #dcd7ba; /* washi paper — text + frame */
parch: #c8c093; /* parchment — the prompt */
grey: #727169;
wave: #7e9cd8; /* crystal-blue wave — the selection */
font: "JetBrainsMono Nerd Font 14";
background-color: transparent;
text-color: @paper;
}
window {
background-color: @sumi;
border: 2px;
border-color: @paper; /* the warm paper frame (kanagawa's border tone) */
border-radius: 10px;
width: calc( 84ch min 65% );
location: center;
anchor: center;
padding: 8px;
}
mainbox {
background-color: transparent;
children: [ inputbar, message, listview ];
spacing: 0px;
}
inputbar {
children: [ prompt, entry ];
background-color: @well; /* the ink well */
text-color: @paper;
border-radius: 8px;
padding: 10px 12px;
spacing: 8px;
margin: 0px 0px 8px 0px;
}
prompt { text-color: @parch; }
entry {
text-color: @paper;
cursor: text;
placeholder: "search…";
placeholder-color: @grey;
}
listview {
background-color: transparent;
columns: 1;
lines: 8;
dynamic: true;
scrollbar: true;
spacing: 4px;
padding: 8px 0px 0px 0px;
}
element {
background-color: transparent;
text-color: @paper;
orientation: horizontal;
border-radius: 8px;
padding: 10px 14px;
spacing: 12px;
}
element alternate.normal {
background-color: @well;
}
element selected.normal {
background-color: @wave;
text-color: @sumi;
}
element-icon {
background-color: transparent;
size: 36px;
cursor: inherit;
}
element-text {
background-color: transparent;
text-color: inherit;
highlight: bold;
vertical-align: 0.5;
}
message { padding: 8px 0px 0px 0px; }
textbox {
background-color: @well;
text-color: @paper;
border-radius: 8px;
padding: 8px 12px;
}
scrollbar {
width: 4px;
handle-width: 4px;
handle-color: @wave;
background-color: @well;
border: 0px;
}