Pass config from main to the relevant places
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -5,13 +5,13 @@ mod css;
|
||||
mod ctl;
|
||||
mod ui;
|
||||
|
||||
use crate::config::Config;
|
||||
use glib::clone;
|
||||
use gtk::prelude::*;
|
||||
use gtk::{Application, CssProvider, gdk, gio};
|
||||
use jmb_logger_rs::*;
|
||||
use notify::RecommendedWatcher;
|
||||
use std::cell::RefCell;
|
||||
use std::process::Command;
|
||||
use std::rc::Rc;
|
||||
|
||||
pub const LOGGER: Logger = Logger::create(Level::DEBUG);
|
||||
@@ -20,16 +20,14 @@ pub const APP_NAME: &str = "net.jmb19905.jmb-bar";
|
||||
fn main() {
|
||||
info!(&LOGGER, "Starting jmb-bar");
|
||||
|
||||
gio::resources_register_include!("templates.gresource").expect("Failed to register resources");
|
||||
let config = Config::load();
|
||||
let backend = Backend::start(&config);
|
||||
|
||||
gio::resources_register_include!("templates.gresource").expect("Failed to register resources");
|
||||
let app = Application::builder().application_id(APP_NAME).build();
|
||||
|
||||
let watcher_slot: Rc<RefCell<Option<RecommendedWatcher>>> = Rc::new(RefCell::new(None));
|
||||
|
||||
let _ = Command::new("pkill hypridle").output(); // Kill existing hypridle processes
|
||||
|
||||
let backend = Backend::start();
|
||||
|
||||
app.connect_startup(move |_| {
|
||||
debug!(&LOGGER, "Connect startup");
|
||||
let provider = CssProvider::new();
|
||||
|
||||
Reference in New Issue
Block a user