Welcome to Centmin Mod Community
Register Now

Beta Branch add opt-in fancy dmotd render mode with Unicode + badges in 140.00beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, May 19, 2026.

  1. eva2000

    eva2000 Administrator Staff Member

    59,480
    12,536
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,176
    Local Time:
    11:29 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    add opt-in fancy dmotd render mode with Unicode + badges in 140.00beta01

    DMOTD_FANCY='n' (default off) adds a third render path on top of the
    opt-in compact mode shipped in e4af2aab: Unicode box-drawing rules
    (━ heavy / ─ light), Unicode column separator (│), 10-char progress
    bars on mem and disk rows (▓░), and colored ASCII status badges
    ([OK] / [!!] / [XX]) on the status footer and CSF safety banner.

    Capability detection (_dmotd_fancy_capable) gates on real TTY, UTF-8
    locale, tput colors >= 8, TERM != dumb, and >= 75 cols — auto-falls
    back to compact ASCII when any check fails. Detection result is
    stashed once into _DMOTD_FANCY_ACTIVE; the user's DMOTD_COMPACT
    setting is never mutated (derived _DMOTD_COMPACT_EFFECTIVE is the
    internal canonical signal).

    Status-line entries push with explicit warn|/ok|/crit| tags rather
    than relying on prefix sniffing — fixes the misclassification where
    nginx/PHP/Centmin Mod "update available" lines would have shown OK
    green. cmsec_checks compact path gets badge prefixes via direct edits
    to its inline printf (separate from the footer renderer, which
    cmsec doesn't feed through).

    Changes:
    - config/motd/dmotd.sh: add DMOTD_FANCY toggle, _dmotd_fancy_capable
    helper, _fancy_rule_heavy/_light/_dmotd_sep_heavy/_light/_fancy_badge/
    _fancy_bar render helpers, _DMOTD_COMPACT_EFFECTIVE resolution block,
    warn|/ok| tags on all _dmotd_status_lines push sites, badge-aware
    render_compact_status_footer splitting on '|', fancy-mode branches
    in motd_output for header/mem/disk/CSF banner, cmsec_checks inline-
    printf badge variants
    - example/custom_config.inc: document DMOTD_FANCY toggle with note
    on cmsec uniformity requiring DMOTD_CVECHECK_COMPACT='y'

    Continue reading...


    140.00beta01 branch