diff options
Diffstat (limited to 'src/config.rs')
| -rw-r--r-- | src/config.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 8465eee..5b657d0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -3,6 +3,7 @@ use crate::protocol::zwlr_layer_surface_v1; use anyhow::{Context, Result}; use pangocairo::pango::FontDescription; use serde::{de, Deserialize}; +use std::collections::HashMap; use std::fs::read_to_string; use std::ops::Deref; use std::path::PathBuf; @@ -44,6 +45,8 @@ pub struct Config { pub show_layout_name: bool, // wm-specific pub wm: WmConfig, + // overrides + pub output: HashMap<String, OutputOverrides>, } impl Default for Config { @@ -84,6 +87,8 @@ impl Default for Config { wm: WmConfig { river: RiverConfig { max_tag: 9 }, }, + + output: HashMap::new(), } } } @@ -110,6 +115,13 @@ impl Config { } }) } + + pub fn output_enabled(&self, output: &str) -> bool { + self.output + .get(output) + .and_then(|o| o.enable) + .unwrap_or(true) + } } fn config_dir() -> Option<PathBuf> { @@ -144,6 +156,12 @@ pub struct RiverConfig { pub max_tag: u8, } +#[derive(Debug, Deserialize)] +pub struct OutputOverrides { + #[serde(default)] + enable: Option<bool>, +} + #[derive(Debug)] pub struct Font(pub FontDescription); |
