Skip to content

Commit 97aac3a

Browse files
committed
reset.
1 parent 920af40 commit 97aac3a

4 files changed

Lines changed: 83 additions & 26 deletions

File tree

usr/libexec/mios/mios-dashboard.sh

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
# MiOS live system dashboard. Renders to ANY tty -- detects color
55
# capability, degrades to plain ASCII on tty0 / `linux` console.
66
#
7-
# Everything renders inside an 80-column frame so output never bleeds
8-
# past a tty0/console viewport. Long lines are truncated with an
9-
# ellipsis (default) or marquee-scrolled when --ticker is passed.
7+
# Everything renders inside a frame whose width comes from
8+
# /usr/share/mios/mios.toml [terminal].cols - [terminal].right_margin
9+
# (default 80, edge-to-edge), so output never bleeds past the tty0 /
10+
# console viewport. Long lines are truncated with an ellipsis (default)
11+
# or marquee-scrolled when --ticker is passed.
1012
#
1113
# Modes:
1214
# default : framed header (ASCII art) + fastfetch + services + loop hint
@@ -18,9 +20,13 @@
1820
# blocks until Ctrl-C, so NOT used in motd path)
1921
# --no-frame : disable the outer frame (legacy / debug)
2022
#
21-
# Frame dimensions are FIXED at 80 cols wide. The Windows desktop
22-
# launcher (build-mios.ps1's Install-WindowsBranding) sizes its
23-
# Windows Terminal profile to match exactly.
23+
# Frame dimensions are sourced from /usr/share/mios/mios.toml [terminal]
24+
# (cols, right_margin) -- WIDTH = cols - right_margin, edge-to-edge by
25+
# default (cols=80, right_margin=0 -> WIDTH=80). Set MIOS_TOML to point
26+
# the awk helper at a different TOML file (e.g. for testing). The
27+
# Windows desktop launcher (build-mios.ps1's Install-WindowsBranding)
28+
# reads the same [terminal] keys via its own PowerShell TOML reader,
29+
# so cross-platform values stay aligned.
2430
#
2531
# Entry points:
2632
# - /etc/profile.d/zz-mios-motd.sh runs the default mode at every
@@ -77,10 +83,50 @@ else
7783
F_LT="+"; F_RT="+"; F_V="|"
7884
fi
7985

80-
# ── Frame dimensions (FIXED 80 cols) ─────────────────────────────────────────
81-
# 80 = tty0 native width and the Windows Terminal MiOS profile size.
82-
# Inner width = 76: "│ " (2) + content + " │" (2) = 80.
83-
WIDTH=80
86+
# ── Frame dimensions (sourced from mios.toml [terminal]) ─────────────────────
87+
# WIDTH = cols - right_margin. EDGE-TO-EDGE by default
88+
# (right_margin=0, frame_width=cols=80). The TOML is the SSOT --
89+
# mios.html edits flow here on next render. Vendor fallback is
90+
# 80 cols / margin 0 if the TOML is missing (cold first-boot before
91+
# /usr/share/mios is staged). Inner width = WIDTH - 4 because the
92+
# frame chars consume "│ " + content + " │" = 4 cells.
93+
#
94+
# All MiOS consoles (Linux tty0, GNOME terminal, Ptyxis, WT MiOS
95+
# profile, conhost fallback, WSL pwsh dispatcher) honor the same
96+
# [terminal].cols / right_margin via their respective TOML readers
97+
# (Get-MiOS.ps1's Get-MiosTomlValue / mios-dash.ps1's regex / this
98+
# awk helper). No hardcoded 80 anywhere -- if you find one, lift it.
99+
_mios_toml_value() {
100+
local section="$1" key="$2" default="$3"
101+
local toml="${MIOS_TOML:-/usr/share/mios/mios.toml}"
102+
[[ -r "$toml" ]] || { printf '%s' "$default"; return; }
103+
awk -v want_section="$section" -v want_key="$key" -v default="$default" '
104+
BEGIN { in_section = 0; found = 0 }
105+
/^\[/ {
106+
line = $0
107+
sub(/[[:space:]]*#.*$/, "", line)
108+
in_section = (line == "[" want_section "]") ? 1 : 0
109+
next
110+
}
111+
in_section && /^[[:space:]]*[A-Za-z_][A-Za-z0-9_]*[[:space:]]*=/ {
112+
line = $0
113+
sub(/[[:space:]]*#.*$/, "", line)
114+
eq = index(line, "=")
115+
if (eq == 0) next
116+
k = substr(line, 1, eq - 1)
117+
v = substr(line, eq + 1)
118+
gsub(/^[[:space:]]+|[[:space:]]+$/, "", k)
119+
gsub(/^[[:space:]]+|[[:space:]]+$/, "", v)
120+
gsub(/^"|"$/, "", v)
121+
if (k == want_key) { print v; found = 1; exit }
122+
}
123+
END { if (!found) print default }
124+
' "$toml"
125+
}
126+
_mios_cols=$(_mios_toml_value "terminal" "cols" "80")
127+
_mios_rmgn=$(_mios_toml_value "terminal" "right_margin" "0")
128+
WIDTH=$(( _mios_cols - _mios_rmgn ))
129+
(( WIDTH < 20 )) && WIDTH=80 # safety floor: malformed TOML / negative math
84130
INNER=$((WIDTH - 4))
85131

86132
# Identity from install.env (written by mios-bootstrap at install time).

usr/share/mios/configurator/mios.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -911,17 +911,19 @@ <h3>Windows shortcuts</h3>
911911
</p>
912912
<div class="grid">
913913
<fieldset>
914-
<legend>terminal (post-install MiOS app: 80x20 portal feel)</legend>
914+
<legend>terminal (post-install MiOS app: 80x20, edge-to-edge frameless)</legend>
915915
<label for="f-term-cols">cols</label>
916916
<input type="text" id="f-term-cols" data-key="terminal.cols" data-type="int" placeholder="80">
917917
<label for="f-term-rows">rows</label>
918918
<input type="text" id="f-term-rows" data-key="terminal.rows" data-type="int" placeholder="20">
919919
<label for="f-term-scroll">scrollback_rows</label>
920920
<input type="text" id="f-term-scroll" data-key="terminal.scrollback_rows" data-type="int" placeholder="9000">
921-
<label for="f-term-fw">frame_width (cols - 1, borderless fit)</label>
922-
<input type="text" id="f-term-fw" data-key="terminal.frame_width" data-type="int" placeholder="79">
923-
<label for="f-term-fh">frame_height (rows - 1)</label>
924-
<input type="text" id="f-term-fh" data-key="terminal.frame_height" data-type="int" placeholder="19">
921+
<label for="f-term-fw">frame_width (= cols, edge-to-edge)</label>
922+
<input type="text" id="f-term-fw" data-key="terminal.frame_width" data-type="int" placeholder="80">
923+
<label for="f-term-fh">frame_height (= rows, edge-to-edge)</label>
924+
<input type="text" id="f-term-fh" data-key="terminal.frame_height" data-type="int" placeholder="20">
925+
<label for="f-term-rm">right_margin (0 = edge-to-edge; raise only if WT chrome can't be hidden)</label>
926+
<input type="text" id="f-term-rm" data-key="terminal.right_margin" data-type="int" placeholder="0">
925927
</fieldset>
926928
<fieldset>
927929
<legend>terminal.install (BOOTSTRAP window: 80x40 for install output + readme)</legend>

usr/share/mios/mios.toml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,18 +1612,27 @@ podman_pkg = "RedHat.Podman-Desktop"
16121612
# (wt.exe new-tab, conhost fallback, wsl.exe into MiOS-DEV, the
16131613
# auto-elevated bootstrap window, the native-app launcher, Linux tty0
16141614
# console via /etc/profile.d/mios-tty.sh) opens at exactly cols × rows.
1615-
# Frame dims are cols-1 / rows-1 so the dashboard's box-drawing fits
1616-
# inside the borderless + scrollbar-less MiOS terminal without the
1617-
# right border colliding with the line-wrap boundary.
1618-
# Per memory feedback_mios_terminal_dimensions.
1615+
#
1616+
# EDGE-TO-EDGE: frame_width = cols, frame_height = rows, right_margin = 0.
1617+
# The dashboard box-drawing reaches the rightmost paintable cell. The
1618+
# right-aligned powerline block ends at the last paintable cell. There
1619+
# is NO gutter.
1620+
#
1621+
# This requires the WT/MiOS app window to actually be frameless --
1622+
# the [theme] section below sets padding=0, scrollbar_state=hidden,
1623+
# acrylic on, suppress_app_title, launch_mode=focus so the visible cell
1624+
# count == the reported cell count. Any wrap on the right edge is a WT
1625+
# chrome bug (a missing knob in [theme] or in the settings.json patcher);
1626+
# do NOT shrink frame_width / right_margin to mask it. Operator pivot
1627+
# 2026-05-08: stop band-aiding the frame, fix the chrome.
16191628
# ----------------------------------------------------------------------------
16201629
[terminal]
16211630
cols = 80
16221631
rows = 20 # 20 = MiOS portal-feel default; 30 for taller "console" feel
16231632
scrollback_rows = 9000
1624-
frame_width = 78 # cols - 2 -- per operator "framing too wide STILL" the previous cols-1 still wrapped because WT pseudo-console reports 1 cell over the visible cell count when the scrollbar reservation hasn't been applied yet (profiles.defaults scrollbarState='hidden' takes effect after the first paint). cols-2 leaves a 2-cell gutter so neither the box-drawing frame nor the right-aligned powerline block can wrap regardless of WT version / DPI / scrollbar timing.
1625-
frame_height = 19 # rows - 1 -- one row reserved for the prompt under the dashboard
1626-
right_margin = 2 # cells of slack between the rightmost paintable cell and where prompt right-aligned segments stop. Applied in Get-MiOS.ps1's WIDTH calc (MIN(WindowWidth - right_margin, frame_width)) and as a trailing spacer segment in mios.omp.json. cols-2 not cols-1: cols-1 still wrapped on the operator's hardware because the WT reported window width was 1 cell wider than the actual visible/paintable width during the first prompt render.
1633+
frame_width = 80 # = cols. Edge-to-edge -- the dashboard frame paints from col 0 to col cols-1 with no gutter. Vendor default is exactly cols; anything narrower is an operator override (e.g. for a quirky third-party terminal that lies about its width). Get-MiOS.ps1's Show-MiosDashboard, mios-dash.ps1, and mios-dashboard.sh ALL read this value via Get-MiosTomlValue / awk.
1634+
frame_height = 20 # = rows. Edge-to-edge vertically -- the dashboard scrolls naturally and the prompt renders below as a NEW row. The conhost cursor advances past the bottom border on its own; no row needs to be "reserved" inside the frame.
1635+
right_margin = 0 # zero gutter on the right edge. Applied in Get-MiOS.ps1's WIDTH calc (MIN(WindowWidth - right_margin, frame_width)) and in mios-dash.ps1 (cols - right_margin). 0 = edge-to-edge. Increase ONLY if the WT chrome cannot be made frameless on a given host (e.g. a remote conhost without scrollbarState support); the proper home for those workarounds is the consumer, not this knob.
16271636

16281637
# ----------------------------------------------------------------------------
16291638
# [terminal.install] -- the BOOTSTRAP window dims (taller so the install

usr/share/mios/oh-my-posh/mios.omp.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
33
"version": 4,
4-
"//final_space": "true: reserve a trailing cell so oh-my-posh's right-aligned block doesn't push to the actual right edge -- the operator's WT pseudo-console sometimes reports terminal width 1 cell over the visible cell count, which made the trailing time char wrap to the next line ('powerline time wraps to the left side'). Reserving one cell gives the segment safety margin against off-by-one width reports.",
5-
"final_space": true,
4+
"//final_space": "false: edge-to-edge per [terminal].right_margin=0 in mios.toml. The right-aligned powerline block ends exactly at the last paintable cell. Pre-2026-05-08 this was true to mask a WT chrome bug (pseudo-console reporting +1 col before scrollbarState='hidden' took effect on first paint); the proper fix is in mios.toml [theme] (padding=0, scrollbar_state=hidden, launch_mode=focus, suppress_app_title=true) which makes the visible col count == the reported col count. If the rightmost time char ever wraps again, audit the WT settings.json patcher in Get-MiOS.ps1, NOT this knob.",
5+
"final_space": false,
66
"//": [
77
"MiOS Oh-My-Posh theme.",
88
"All Nerd Font private-use-area glyphs are encoded as JSON \\uXXXX",
@@ -209,10 +209,10 @@
209209
"template": " {{ .CurrentDate | date .Format }} "
210210
},
211211
{
212-
"//": "Trailing spacer -- reserves 2 cells of right margin so the powerline right block can't wrap to the next line on hosts where the pseudo-console reports a window width 1+ cells over the visible cells (operator's WT during the first paint, before scrollbarState='hidden' takes effect). final_space=true at the theme root reserves 1 additional cell on top, totaling 3 cells of slack from the rightmost cell. Lifted from mios.toml [terminal].right_margin via build-mios.ps1's mios.omp.json substitution; this 2-space template is the vendor default.",
212+
"//": "Trailing spacer REMOVED 2026-05-08 per operator pivot to edge-to-edge. The right-aligned block now ends at the last paintable cell. mios.toml [terminal].right_margin=0 is the SSOT; if a future operator re-introduces a non-zero margin, the build-mios.ps1 substitution should re-emit this segment with template = (right_margin spaces). For now: kept as a stub for substitution-target stability so build-mios.ps1's regex doesn't break.",
213213
"type": "text",
214214
"style": "plain",
215-
"template": " "
215+
"template": ""
216216
}
217217
]
218218
},

0 commit comments

Comments
 (0)