Strata/strata-daemon/src/config.rs
edu4rdshl 350d647953 Initial commit
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-25 03:02:34 -05:00

23 lines
530 B
Rust

use std::path::PathBuf;
pub struct Config {
pub db_path: PathBuf,
pub max_history: usize,
}
impl Config {
pub fn new() -> Self {
let data_dir = dirs::data_dir()
.unwrap_or_else(|| PathBuf::from("."))
.join("strata");
if let Err(e) = std::fs::create_dir_all(&data_dir) {
tracing::warn!("Could not create data dir {:?}: {}", data_dir, e);
}
Self {
db_path: data_dir.join("clipboard.db"),
max_history: 200,
}
}
}