From d1fe8e5999a5b16cfed7519f80b9710a7fbe1411 Mon Sep 17 00:00:00 2001 From: MaxVerevkin Date: Mon, 21 Aug 2023 16:12:23 +0300 Subject: allow setting config path via cli args --- src/state.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/state.rs') diff --git a/src/state.rs b/src/state.rs index f98e037..dcf7fbe 100644 --- a/src/state.rs +++ b/src/state.rs @@ -5,6 +5,7 @@ use crate::wm_info_provider::*; use std::fmt::Display; use std::os::unix::io::{AsRawFd, RawFd}; +use std::path::Path; use wayrs_client::global::{GlobalExt, Globals, GlobalsExt}; use wayrs_client::proxy::Proxy; @@ -52,10 +53,10 @@ struct Pointer { } impl State { - pub fn new(conn: &mut Connection, globals: &Globals) -> Self { + pub fn new(conn: &mut Connection, globals: &Globals, config_path: Option<&Path>) -> Self { let mut error = Ok(()); - let config = Config::new() + let config = Config::new(config_path) .map_err(|e| error = Err(e)) .unwrap_or_default(); -- cgit v1.3.1