fix: add check for no backends
This commit is contained in:
parent
b8205794cc
commit
b7168724f6
2 changed files with 7 additions and 2 deletions
|
@ -30,7 +30,7 @@ pub struct Config {
|
||||||
pub temp_backend: TempBackend,
|
pub temp_backend: TempBackend,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, PartialEq, Copy, Clone)]
|
||||||
pub enum GammaBackend {
|
pub enum GammaBackend {
|
||||||
Hyprctl,
|
Hyprctl,
|
||||||
Ddcutil,
|
Ddcutil,
|
||||||
|
@ -40,7 +40,7 @@ pub enum GammaBackend {
|
||||||
None,
|
None,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, PartialEq, Copy, Clone)]
|
||||||
pub enum TempBackend {
|
pub enum TempBackend {
|
||||||
Hyprctl,
|
Hyprctl,
|
||||||
Redshift,
|
Redshift,
|
||||||
|
|
|
@ -237,6 +237,11 @@ async fn main() {
|
||||||
TempBackend::None => {}
|
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();
|
CONFIG.set(Arc::new(RwLock::new(cfg))).unwrap();
|
||||||
|
|
||||||
if std::path::Path::new(SOCKET_PATH).exists() {
|
if std::path::Path::new(SOCKET_PATH).exists() {
|
||||||
|
|
Loading…
Reference in a new issue