diff --git a/config.example.toml b/config.example.toml index ba03226..5bb6068 100644 --- a/config.example.toml +++ b/config.example.toml @@ -1,5 +1,5 @@ # MeshTerm configuration. -# Copy to ~/.config/meshterm/config.toml (or pass --db / --port on the CLI). +# Copy to ~/.meshterm/config.toml (or pass --db / --port on the CLI). # # Profiles are optional. With no profile and no --port, MeshTerm discovers attached # serial devices, lets you pick one (interactively) or uses the single one present, and diff --git a/meshterm/core/config.py b/meshterm/core/config.py index eec3f17..a0caf97 100644 --- a/meshterm/core/config.py +++ b/meshterm/core/config.py @@ -1,6 +1,6 @@ """Configuration and named device profiles. -Settings are read from a TOML file (default ``~/.config/meshterm/config.toml``) and may +Settings are read from a TOML file (default ``~/.meshterm/config.toml``) and may be overridden per-invocation by CLI flags. Profiles let you alias your hardware (``yagi`` repeater, ``local`` repeater, ``observer`` bot, ``s3`` serial companion) to a serial port and defaults so commands can target them by name. @@ -22,16 +22,13 @@ else: # pragma: no cover - exercised only on 3.10 def default_config_dir() -> Path: """Return the directory MeshTerm uses for config and data. - Honors ``$XDG_CONFIG_HOME`` when set; otherwise falls back to ``~/.config``. + Resolves to ``.meshterm`` under the OS-defined home directory (``%USERPROFILE%`` + on Windows, ``$HOME`` on Unix), as reported by :meth:`Path.home`. Returns: The resolved configuration directory path (not guaranteed to exist). """ - import os - - base = os.environ.get("XDG_CONFIG_HOME") - root = Path(base) if base else Path.home() / ".config" - return root / "meshterm" + return Path.home() / ".meshterm" @dataclass(slots=True)