fix: add check for ddcutil
This commit is contained in:
parent
e976352087
commit
8a1969aea1
1 changed files with 24 additions and 1 deletions
25
src/main.rs
25
src/main.rs
|
@ -7,7 +7,7 @@ use std::time::{Duration, UNIX_EPOCH};
|
||||||
|
|
||||||
use hinoirisetr::notify::InitializedNotificationSystem;
|
use hinoirisetr::notify::InitializedNotificationSystem;
|
||||||
use hinoirisetr::time::Time;
|
use hinoirisetr::time::Time;
|
||||||
use hinoirisetr::{Config, apply_settings, compute_settings, debug, error, info, trace, warn};
|
use hinoirisetr::{apply_settings, compute_settings, debug, error, info, trace, warn, Config, GammaBackend};
|
||||||
use smol::Timer;
|
use smol::Timer;
|
||||||
use smol::channel::{Sender, unbounded};
|
use smol::channel::{Sender, unbounded};
|
||||||
use smol::io::{AsyncBufReadExt, BufReader};
|
use smol::io::{AsyncBufReadExt, BufReader};
|
||||||
|
@ -211,6 +211,29 @@ fn main() {
|
||||||
Config::default()
|
Config::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: add more temp backends and remove this
|
||||||
|
if !is_binary_available("hyprctl") {
|
||||||
|
error!("hyprctl is not available, exiting.");
|
||||||
|
std::process::exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
match cfg.gamma_backend {
|
||||||
|
GammaBackend::Hyprctl => {
|
||||||
|
if !is_binary_available("hyprctl") {
|
||||||
|
error!("hyprctl is not available, exiting.");
|
||||||
|
std::process::exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GammaBackend::Ddcutil => {
|
||||||
|
if !is_binary_available("ddcutil") {
|
||||||
|
error!("ddcutil is not available, 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