[fix](trx-rs): use cache_dir for recordings and decode logs

Move default output directories from $XDG_DATA_HOME to $XDG_CACHE_HOME
so all runtime data lives under ~/.cache/trx-rs/ consistently.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-04-03 19:33:11 +02:00
parent c8a5e15b3b
commit ced77464f9
2 changed files with 6 additions and 6 deletions
@@ -28,7 +28,7 @@ use tracing::{error, info, warn};
pub struct RecorderConfig {
/// Whether the recorder feature is available.
pub enabled: bool,
/// Directory for recorded files. Default: `$XDG_DATA_HOME/trx-rs/recordings/`.
/// Directory for recorded files. Default: `$XDG_CACHE_HOME/trx-rs/recordings/`.
pub output_dir: Option<String>,
/// Maximum duration of a single recording in seconds. None = unlimited.
pub max_duration_secs: Option<u64>,
@@ -49,8 +49,8 @@ impl RecorderConfig {
if let Some(ref dir) = self.output_dir {
PathBuf::from(dir)
} else {
dirs::data_dir()
.unwrap_or_else(|| PathBuf::from("."))
dirs::cache_dir()
.unwrap_or_else(|| PathBuf::from(".cache"))
.join("trx-rs")
.join("recordings")
}