feat(config): add Default trait implementation

Swadhin Biswas committed 8 months ago
16538b6
1 parent 1775455
commit 16538b6
1 file changed
+50 -0
Showing 1 changed file+50-0
▼src/config/mod.rs
+50-0
48
48
49
49
// ── ASCII / Logo options ─────────────────────────────────────
50
50
51
+ /// Image backend: "ascii", "kitty", "sixel", "chafa", "off"
52
+ #[serde(default = "default_ascii")]
53
+ pub image_backend: String,
54
+
55
+ /// Image source: "auto", "ascii", "wallpaper", "/path/to/image"
56
+ #[serde(default = "default_auto")]
57
+ pub image_source: String,
58
+
59
+ /// Which distro's ASCII art to display: "auto", "arch", "ubuntu", etc.
60
+ #[serde(default = "default_auto")]
61
+ pub ascii_distro: String,
62
+
63
+ /// Path to a custom ASCII art file (overrides ascii_distro)
64
+ /// The file can contain {c1}..{c6} color placeholders
65
+ #[serde(default)]
66
+ pub ascii_file: Option<String>,
67
+
68
+ /// Colors for ASCII art: "distro" or explicit [6, 6, 7, 1]
69
+ #[serde(default)]
70
+ pub ascii_colors: ColorConfig,
71
+
72
+ /// Bold the ASCII art
73
+ #[serde(default = "default_true")]
74
+ pub ascii_bold: bool,
75
+
76
+ // ── Image options ────────────────────────────────────────────
77
+
78
+ /// Path to custom image to display (for kitty/sixel/chafa backends)
79
+ #[serde(default)]
80
+ pub custom_image: Option<String>,
81
+
82
+ /// Image size: "auto", "none", or "NNpx" / "NN%"
83
+ #[serde(default = "default_auto")]
84
+ pub image_size: String,
85
+
86
+ /// Crop mode: "normal", "fit", "fill"
87
+ #[serde(default = "default_normal")]
88
+ pub crop_mode: String,
89
+
90
+ /// Crop offset: "center", "north", "south", "east", "west", etc.
91
+ #[serde(default = "default_center")]
92
+ pub crop_offset: String,
93
+
94
+ // ── Extra features ───────────────────────────────────────────
95
+
96
+ /// Use emoji art instead of ASCII art
97
+ #[serde(default = "default_false")]
98
+ pub emoji_mode: bool,
99
+
100
+ /// Use Nerd Font icons for info labels
51
101