Expand description
XDG-aware filesystem paths for LinkMarks.
All defaults follow the XDG Base Directory specification:
- Data:
${XDG_DATA_HOME:-~/.local/share}/linkmarks/ - Config:
${XDG_CONFIG_HOME:-~/.config}/linkmarks/
On macOS / Windows the dirs crate falls back to ~/Library/Application Support/linkmarks
and %APPDATA%\linkmarks respectively. The CLI exposes --data-dir,
--store, and --config flags to override these defaults at runtime.
Constants§
- APP_DIR
- Application name used as the XDG leaf directory.
- CONFIG_
FILENAME - Config filename inside the config directory.
- STORE_
FILENAME - Store filename inside the data directory.
Functions§
- default_
config_ dir_ display - Convenience helper: returns the default config directory as
Stringfor error messages; returns the literal string when the path cannot be represented. - default_
data_ dir_ display - Convenience helper: returns the default config directory as
&strfor error messages; returns the literal string when the path cannot be represented. - ensure_
config_ dir - Create the config directory (and parents) if it does not exist.
- ensure_
data_ dir - Create the data directory (and parents) if it does not exist.
- is_
inside_ data_ dir - Returns whether the path lives under the configured data directory.
- linkmarks_
config_ dir - Returns the config directory (
${XDG_CONFIG_HOME:-~/.config}/linkmarks). - linkmarks_
config_ path - Returns the default config file path (
<config_dir>/config.toml). - linkmarks_
data_ dir - Returns the data directory (
${XDG_DATA_HOME:-~/.local/share}/linkmarks). - linkmarks_
store_ path - Returns the default SQLite store path (
<data_dir>/store.db).