Store config and data under ~/.meshterm

Move the default config directory from ~/.config/meshterm (with
XDG_CONFIG_HOME support) to a plain ~/.meshterm dotfolder under the
OS-defined home directory.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jean-Pierre MartineauandClaude Opus 4.8 committed 2026-07-07 20:08:06 -04:00
1 parent 2ec18138a7
commit 7dbe4373be
2 files changed
+5 -8

No files matched your search

+1 -1
View File
@@ -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
+4 -7
View File
@@ -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)