tca-loader
XDG-compliant theme loader for Terminal Colors Architecture.
Overview
Provides filesystem operations for discovering and loading TCA themes from XDG data directories. Follows the XDG Base Directory specification.
Installation
[]
= "0.1"
Usage
Theme Discovery
use ;
// Get XDG theme directory path
let themes_dir = get_themes_dir?;
// Returns: ~/.local/share/tca/themes (or equivalent)
// List all theme files
let theme_paths = list_themes?;
// List theme names (without extensions)
let names = list_theme_names?;
Loading Themes
use ;
use Theme;
// Find theme by name (searches XDG directory)
let path = find_theme?;
// Load with specific type
let theme: Theme = load_theme?;
// Or load from explicit path
use load_theme_file;
let theme: Theme = load_theme_file?;
Generic Type Support
Works with any deserializable type:
use Deserialize;
let custom: CustomTheme = load_theme?;
XDG Compliance
Theme directory resolution follows XDG Base Directory spec:
$XDG_DATA_HOME/tca/themes/(default:~/.local/share/tca/themes/)- Falls back to first writable location if directory doesn't exist
License
MIT