diff --git a/src/lib.rs b/src/lib.rs index 3d62dca..537fb43 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,7 +30,7 @@ pub struct Config { pub temp_backend: TempBackend, } -#[derive(Debug, Copy, Clone)] +#[derive(Debug, PartialEq, Copy, Clone)] pub enum GammaBackend { Hyprctl, Ddcutil, @@ -40,7 +40,7 @@ pub enum GammaBackend { None, } -#[derive(Debug, Copy, Clone)] +#[derive(Debug, PartialEq, Copy, Clone)] pub enum TempBackend { Hyprctl, Redshift, diff --git a/src/main.rs b/src/main.rs index a3c8802..9ac543b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -237,6 +237,11 @@ async fn main() { TempBackend::None => {} } + if cfg.temp_backend == TempBackend::None && cfg.gamma_backend == GammaBackend::None { + error!("No backends selected, exiting."); + std::process::exit(1); + } + CONFIG.set(Arc::new(RwLock::new(cfg))).unwrap(); if std::path::Path::new(SOCKET_PATH).exists() {