fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 1 | //! The TOML config. Parsing and validation only, the compositor applies it. |
57f44a63d99f | atagen | 2026-10-16 05:34 UTC | 2 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 3 | use monolith_ipc::Command; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 4 | use regex::Regex; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 5 | use serde::Deserialize; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 6 | use std::collections::BTreeMap; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 7 | use std::fmt; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 8 | use std::path::{Path, PathBuf}; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 9 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 10 | pub const DEFAULT: &str = include_str!("../default.toml"); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 11 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 12 | #[derive(Debug, Clone)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 13 | pub struct Config { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 14 | pub general: General, |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 15 | pub output: Outputs, |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 16 | pub decoration: Decoration, |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 17 | pub animation: Animation, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 18 | pub keyboard: Keyboard, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 19 | pub binds: Vec<Bind>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 20 | pub rules: Vec<Rule>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 21 | pub startup: Vec<Vec<String>>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 22 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 23 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 24 | #[derive(Deserialize, Debug, Clone, PartialEq)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 25 | #[serde(default, deny_unknown_fields)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 26 | pub struct General { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 27 | /// What `Mod` means in binds. |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 28 | #[serde(rename = "mod")] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 29 | pub mod_key: Modifier, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 30 | pub gaps: Gaps, |
4444c779eb48 | atagen | 2026-10-16 12:07 UTC | 31 | /// What a window move does when it meets a neighbour. |
4444c779eb48 | atagen | 2026-10-16 12:07 UTC | 32 | #[serde(rename = "move")] |
4444c779eb48 | atagen | 2026-10-16 12:07 UTC | 33 | pub move_mode: MoveMode, |
4444c779eb48 | atagen | 2026-10-16 12:07 UTC | 34 | } |
4444c779eb48 | atagen | 2026-10-16 12:07 UTC | 35 | |
4444c779eb48 | atagen | 2026-10-16 12:07 UTC | 36 | #[derive(Deserialize, Debug, Clone, Copy, PartialEq, Eq, Default)] |
4444c779eb48 | atagen | 2026-10-16 12:07 UTC | 37 | #[serde(rename_all = "lowercase")] |
4444c779eb48 | atagen | 2026-10-16 12:07 UTC | 38 | pub enum MoveMode { |
4444c779eb48 | atagen | 2026-10-16 12:07 UTC | 39 | /// Trade places with it. |
4444c779eb48 | atagen | 2026-10-16 12:07 UTC | 40 | #[default] |
4444c779eb48 | atagen | 2026-10-16 12:07 UTC | 41 | Swap, |
4444c779eb48 | atagen | 2026-10-16 12:07 UTC | 42 | /// Join its lane, stacking with it if it is alone. |
4444c779eb48 | atagen | 2026-10-16 12:07 UTC | 43 | Merge, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 44 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 45 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 46 | impl Default for General { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 47 | fn default() -> Self { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 48 | Self { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 49 | mod_key: Modifier::Super, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 50 | gaps: Gaps::default(), |
4444c779eb48 | atagen | 2026-10-16 12:07 UTC | 51 | move_mode: MoveMode::Swap, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 52 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 53 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 54 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 55 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 56 | #[derive(Deserialize, Debug, Clone, Copy, PartialEq)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 57 | #[serde(default, deny_unknown_fields)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 58 | pub struct Gaps { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 59 | pub inner: f64, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 60 | pub outer: f64, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 61 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 62 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 63 | impl Default for Gaps { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 64 | fn default() -> Self { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 65 | Self { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 66 | inner: 8.0, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 67 | outer: 8.0, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 68 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 69 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 70 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 71 | |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 72 | #[derive(Deserialize, Debug, Clone, PartialEq, Default)] |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 73 | #[serde(default, deny_unknown_fields)] |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 74 | pub struct Outputs { |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 75 | pub vrr: Vrr, |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 76 | } |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 77 | |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 78 | #[derive(Deserialize, Debug, Clone, Copy, PartialEq, Eq, Default)] |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 79 | #[serde(rename_all = "lowercase")] |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 80 | pub enum Vrr { |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 81 | Off, |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 82 | On, |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 83 | /// Only while a fullscreen window is shown, where a game sets the pace. |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 84 | #[default] |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 85 | Fullscreen, |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 86 | } |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 87 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 88 | #[derive(Deserialize, Debug, Clone, PartialEq)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 89 | #[serde(default, deny_unknown_fields)] |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 90 | pub struct Decoration { |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 91 | /// Border width in logical pixels, drawn in the gap around each window. |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 92 | pub border: u32, |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 93 | pub focused: Color, |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 94 | pub unfocused: Color, |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 95 | } |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 96 | |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 97 | impl Default for Decoration { |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 98 | fn default() -> Self { |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 99 | Self { |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 100 | border: 2, |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 101 | focused: Color::rgb(0x88, 0xbf, 0xd1), |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 102 | unfocused: Color::rgb(0x3b, 0x42, 0x52), |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 103 | } |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 104 | } |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 105 | } |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 106 | |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 107 | /// Straight RGBA from `#rrggbb` or `#rrggbbaa`. |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 108 | #[derive(Debug, Clone, Copy, PartialEq)] |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 109 | pub struct Color(pub [f32; 4]); |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 110 | |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 111 | impl Color { |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 112 | pub const fn rgb(r: u8, g: u8, b: u8) -> Self { |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 113 | Self([r as f32 / 255.0, g as f32 / 255.0, b as f32 / 255.0, 1.0]) |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 114 | } |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 115 | } |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 116 | |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 117 | impl<'de> Deserialize<'de> for Color { |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 118 | fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> { |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 119 | let s = String::deserialize(d)?; |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 120 | let hex = s.strip_prefix('#').unwrap_or(&s); |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 121 | let bad = |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 122 | || serde::de::Error::custom(format!("bad colour {s:?}, use #rrggbb or #rrggbbaa")); |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 123 | if !matches!(hex.len(), 6 | 8) || !hex.is_ascii() { |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 124 | return Err(bad()); |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 125 | } |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 126 | let mut c = [1.0f32; 4]; |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 127 | for (i, v) in c.iter_mut().enumerate().take(hex.len() / 2) { |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 128 | let byte = u8::from_str_radix(&hex[i * 2..i * 2 + 2], 16).map_err(|_| bad())?; |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 129 | *v = f32::from(byte) / 255.0; |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 130 | } |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 131 | Ok(Self(c)) |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 132 | } |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 133 | } |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 134 | |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 135 | #[derive(Deserialize, Debug, Clone, PartialEq)] |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 136 | #[serde(default, deny_unknown_fields)] |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 137 | pub struct Animation { |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 138 | pub enabled: bool, |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 139 | pub style: AnimationStyle, |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 140 | /// Every phase of a planned transition lasts this long. |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 141 | pub phase_ms: u64, |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 142 | /// A cubic bezier, as in CSS. |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 143 | pub curve: [f64; 4], |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 144 | } |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 145 | |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 146 | impl Default for Animation { |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 147 | fn default() -> Self { |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 148 | Self { |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 149 | enabled: true, |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 150 | style: AnimationStyle::Orthogonal, |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 151 | phase_ms: 160, |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 152 | curve: [0.45, 0.0, 0.2, 1.0], |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 153 | } |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 154 | } |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 155 | } |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 156 | |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 157 | #[derive(Deserialize, Debug, Clone, Copy, PartialEq, Eq)] |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 158 | #[serde(rename_all = "lowercase")] |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 159 | pub enum AnimationStyle { |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 160 | Orthogonal, |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 161 | Direct, |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 162 | } |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 163 | |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 164 | #[derive(Deserialize, Debug, Clone, PartialEq)] |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 165 | #[serde(default, deny_unknown_fields)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 166 | pub struct Keyboard { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 167 | pub rules: String, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 168 | pub model: String, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 169 | pub layout: String, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 170 | pub variant: String, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 171 | pub options: Option<String>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 172 | pub repeat_delay: i32, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 173 | pub repeat_rate: i32, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 174 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 175 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 176 | impl Default for Keyboard { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 177 | fn default() -> Self { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 178 | Self { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 179 | rules: String::new(), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 180 | model: String::new(), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 181 | layout: String::new(), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 182 | variant: String::new(), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 183 | options: None, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 184 | repeat_delay: 200, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 185 | repeat_rate: 25, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 186 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 187 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 188 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 189 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 190 | #[derive(Deserialize, Debug, Clone, Copy, PartialEq, Eq)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 191 | #[serde(rename_all = "lowercase")] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 192 | pub enum Modifier { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 193 | Super, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 194 | Alt, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 195 | Ctrl, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 196 | Shift, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 197 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 198 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 199 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Hash)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 200 | pub struct Mods { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 201 | pub logo: bool, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 202 | pub alt: bool, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 203 | pub ctrl: bool, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 204 | pub shift: bool, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 205 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 206 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 207 | impl Mods { |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 208 | pub fn has(&self, m: Modifier) -> bool { |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 209 | match m { |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 210 | Modifier::Super => self.logo, |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 211 | Modifier::Alt => self.alt, |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 212 | Modifier::Ctrl => self.ctrl, |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 213 | Modifier::Shift => self.shift, |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 214 | } |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 215 | } |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 216 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 217 | fn set(&mut self, m: Modifier) { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 218 | match m { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 219 | Modifier::Super => self.logo = true, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 220 | Modifier::Alt => self.alt = true, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 221 | Modifier::Ctrl => self.ctrl = true, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 222 | Modifier::Shift => self.shift = true, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 223 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 224 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 225 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 226 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 227 | #[derive(Debug, Clone, PartialEq)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 228 | pub struct Bind { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 229 | pub mods: Mods, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 230 | /// An xkb keysym name, resolved by the compositor. |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 231 | pub key: String, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 232 | pub command: Command, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 233 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 234 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 235 | #[derive(Debug, Clone)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 236 | pub struct Rule { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 237 | pub app_id: Option<Regex>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 238 | pub title: Option<Regex>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 239 | pub tag: Option<String>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 240 | pub output: Option<String>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 241 | pub floating: Option<bool>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 242 | pub sticky: Option<bool>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 243 | pub scratchpad: Option<String>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 244 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 245 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 246 | /// Everything the matching rules say about a window, later rules winning. |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 247 | #[derive(Debug, Clone, Default, PartialEq)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 248 | pub struct Placement { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 249 | pub tag: Option<String>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 250 | pub output: Option<String>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 251 | pub floating: Option<bool>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 252 | pub sticky: Option<bool>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 253 | pub scratchpad: Option<String>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 254 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 255 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 256 | #[derive(Debug)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 257 | pub enum Error { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 258 | Io(PathBuf, std::io::Error), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 259 | Toml(toml::de::Error), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 260 | Bind(String, String), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 261 | Regex(String, regex::Error), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 262 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 263 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 264 | impl fmt::Display for Error { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 265 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 266 | match self { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 267 | Error::Io(p, e) => write!(f, "{}: {e}", p.display()), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 268 | Error::Toml(e) => write!(f, "{e}"), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 269 | Error::Bind(k, e) => write!(f, "bind {k:?}: {e}"), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 270 | Error::Regex(r, e) => write!(f, "rule pattern {r:?}: {e}"), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 271 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 272 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 273 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 274 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 275 | impl std::error::Error for Error {} |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 276 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 277 | #[derive(Deserialize)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 278 | #[serde(deny_unknown_fields)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 279 | struct Raw { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 280 | #[serde(default)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 281 | startup: Vec<Vec<String>>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 282 | #[serde(default)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 283 | general: General, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 284 | #[serde(default)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 285 | keyboard: Keyboard, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 286 | #[serde(default)] |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 287 | animation: Animation, |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 288 | #[serde(default)] |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 289 | decoration: Decoration, |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 290 | #[serde(default)] |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 291 | output: Outputs, |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 292 | #[serde(default)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 293 | binds: BTreeMap<String, Words>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 294 | #[serde(default)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 295 | rules: Vec<RawRule>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 296 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 297 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 298 | #[derive(Deserialize)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 299 | #[serde(untagged)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 300 | enum Words { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 301 | Line(String), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 302 | List(Vec<String>), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 303 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 304 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 305 | #[derive(Deserialize)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 306 | #[serde(deny_unknown_fields)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 307 | struct RawRule { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 308 | app_id: Option<String>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 309 | title: Option<String>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 310 | tag: Option<String>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 311 | output: Option<String>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 312 | floating: Option<bool>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 313 | sticky: Option<bool>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 314 | scratchpad: Option<String>, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 315 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 316 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 317 | impl Config { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 318 | /// `$MONOLITH_CONFIG`, else `$XDG_CONFIG_HOME/monolith/config.toml`. |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 319 | pub fn path() -> Option<PathBuf> { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 320 | if let Some(p) = std::env::var_os("MONOLITH_CONFIG") { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 321 | return Some(p.into()); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 322 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 323 | let base = std::env::var_os("XDG_CONFIG_HOME") |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 324 | .map(PathBuf::from) |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 325 | .or_else(|| std::env::var_os("HOME").map(|h| PathBuf::from(h).join(".config")))?; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 326 | Some(base.join("monolith/config.toml")) |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 327 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 328 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 329 | /// Loads `path`, or the built-in default when it does not exist. |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 330 | pub fn load(path: Option<&Path>) -> Result<Self, Error> { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 331 | match path { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 332 | Some(p) => match std::fs::read_to_string(p) { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 333 | Ok(text) => Self::parse(&text), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 334 | Err(e) if e.kind() == std::io::ErrorKind::NotFound => Self::parse(DEFAULT), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 335 | Err(e) => Err(Error::Io(p.to_owned(), e)), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 336 | }, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 337 | None => Self::parse(DEFAULT), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 338 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 339 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 340 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 341 | pub fn parse(text: &str) -> Result<Self, Error> { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 342 | let raw: Raw = toml::from_str(text).map_err(Error::Toml)?; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 343 | let mod_key = raw.general.mod_key; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 344 | let binds = raw |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 345 | .binds |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 346 | .into_iter() |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 347 | .map(|(combo, words)| parse_bind(&combo, words, mod_key)) |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 348 | .collect::<Result<_, _>>()?; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 349 | let regex = |p: Option<String>| { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 350 | p.map(|p| Regex::new(&p).map_err(|e| Error::Regex(p, e))) |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 351 | .transpose() |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 352 | }; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 353 | let rules = raw |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 354 | .rules |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 355 | .into_iter() |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 356 | .map(|r| { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 357 | Ok(Rule { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 358 | app_id: regex(r.app_id)?, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 359 | title: regex(r.title)?, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 360 | tag: r.tag, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 361 | output: r.output, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 362 | floating: r.floating, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 363 | sticky: r.sticky, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 364 | scratchpad: r.scratchpad, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 365 | }) |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 366 | }) |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 367 | .collect::<Result<_, Error>>()?; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 368 | Ok(Self { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 369 | general: raw.general, |
2af1d8c55876 | atagen | 2026-10-16 11:05 UTC | 370 | animation: raw.animation, |
7ce6ae4e5a85 | atagen | 2026-10-16 12:16 UTC | 371 | decoration: raw.decoration, |
8e6f96f0a32d | atagen | 2026-10-16 22:17 UTC | 372 | output: raw.output, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 373 | keyboard: raw.keyboard, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 374 | binds, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 375 | rules, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 376 | startup: raw.startup, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 377 | }) |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 378 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 379 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 380 | pub fn placement(&self, app_id: &str, title: &str) -> Placement { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 381 | let mut p = Placement::default(); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 382 | let hit = |re: &Option<Regex>, s: &str| re.as_ref().is_none_or(|re| re.is_match(s)); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 383 | for r in &self.rules { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 384 | if !hit(&r.app_id, app_id) || !hit(&r.title, title) { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 385 | continue; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 386 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 387 | p.tag = r.tag.clone().or(p.tag); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 388 | p.output = r.output.clone().or(p.output); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 389 | p.floating = r.floating.or(p.floating); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 390 | p.sticky = r.sticky.or(p.sticky); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 391 | p.scratchpad = r.scratchpad.clone().or(p.scratchpad); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 392 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 393 | p |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 394 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 395 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 396 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 397 | fn parse_bind(combo: &str, words: Words, mod_key: Modifier) -> Result<Bind, Error> { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 398 | let bad = |m: String| Error::Bind(combo.to_owned(), m); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 399 | let parts: Vec<&str> = combo.split('+').map(str::trim).collect(); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 400 | let Some((&key, mods)) = parts.split_last().filter(|(k, _)| !k.is_empty()) else { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 401 | return Err(bad("no key".into())); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 402 | }; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 403 | let mut set = Mods::default(); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 404 | for m in mods { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 405 | let m = match m.to_ascii_lowercase().as_str() { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 406 | "mod" => mod_key, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 407 | "super" | "logo" | "win" => Modifier::Super, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 408 | "alt" => Modifier::Alt, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 409 | "ctrl" | "control" => Modifier::Ctrl, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 410 | "shift" => Modifier::Shift, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 411 | other => return Err(bad(format!("unknown modifier {other}"))), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 412 | }; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 413 | set.set(m); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 414 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 415 | let words: Vec<String> = match words { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 416 | Words::Line(s) => s.split_whitespace().map(str::to_owned).collect(), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 417 | Words::List(v) => v, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 418 | }; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 419 | let command = Command::parse(&words).map_err(|e| bad(e.0))?; |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 420 | Ok(Bind { |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 421 | mods: set, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 422 | key: key.to_owned(), |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 423 | command, |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 424 | }) |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 425 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 426 | |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 427 | #[cfg(test)] |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 428 | mod tests { |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 429 | use super::*; |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 430 | |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 431 | /// default.toml documents the defaults for users, and the Default impls |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 432 | /// apply them to sections a user config leaves out. They must agree. |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 433 | #[test] |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 434 | fn default_toml_states_the_defaults() { |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 435 | let c = Config::parse(DEFAULT).unwrap(); |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 436 | assert_eq!(c.general, General::default()); |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 437 | assert_eq!(c.output, Outputs::default()); |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 438 | assert_eq!(c.decoration, Decoration::default()); |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 439 | assert_eq!(c.animation, Animation::default()); |
b22c0511d5af | atagen | 2026-10-17 03:48 UTC | 440 | assert_eq!(c.keyboard, Keyboard::default()); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 441 | assert!(c.binds.len() > 40); |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 442 | } |
fe835aed6c8d | atagen | 2026-10-16 10:05 UTC | 443 | } |