Skip to content

Named profiles: --profile + BITTY_CONFIG/BITTY_PROFILE env overrides #271

Closed

Description

@Xuepoo

Decision (owner, 2026-09-04): --config AND --profile, different jobs

  • --config PATH (exists): explicit file — debugging, portable dotfiles, testing. Keep.
  • --profile NAME (new): named profile from $XDG_CONFIG_HOME/bitty/profiles/<name>.lua, layered UNDER user config per lua-and-xdg.md (CLI > local > user > profile > distribution > system > core default): the profile composes the base, init.lua still wins over it. Use cases: work/home, minimal/test, presentation.
  • Env overrides (12-factor, test-friendly): BITTY_CONFIG (path), BITTY_PROFILE (name).
  • Precedence: CLI flags > BITTY_* env > init.lua + profile layer > built-in defaults. --config + --profile together: profile still layers over the explicit file (document; warn on stderr).
  • XDG semantics: user-level $XDG_CONFIG_HOME (fallback ~/.config); XDG_CONFIG_DIRS is system-wide and NOT used for user config.
  • Demo pump line: deleted entirely (Startup always prints demo pump line; remove or gate synthetic output #269), not gated behind profile.

Acceptance

  • --profile work loads profiles/work.lua as the profile layer (init.lua still overrides it); missing profile = clear error exit 2 (no fallback guessing).
  • BITTY_PROFILE honored; config check shows profile layer + source per key.
  • Tests for precedence matrix (CLI/env/file/default) + fail-closed missing profile.
  • Live proof: two profiles render differently (e.g. theme/font size) with screenshots.

Priority: P2 | Area: config | Labels: feat,area:config,P2 | Milestone: v0.1.0 | RFC: - | Task: TBD

  • Canonical spec: bitty-docs/docs/configuration/lua-and-xdg.md (profiles §238, precedence §184); implementation must follow it, docs sync is part of done.

Activity

  1. added this to the v0.1.0 milestone on Sep 4, 2026
  2. added
    feat
    area:config
    P2
    on Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2area:configfeat

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions