diff --git a/src/config.rs b/src/config.rs index 0a59f00..f4c3e2b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -7,17 +7,10 @@ pub struct WindowIcon { pub substring: String } #[derive(Serialize,Deserialize,Clone,Debug)] -pub struct BrowserConf { - pub profile: String, - pub startpage: String -} -#[derive(Serialize,Deserialize,Clone,Debug)] pub struct Profile { pub name: String, pub icon: String, - pub browser: BrowserConf, - pub directory: String, -// pub index: u32 + pub program_args: Option>>, } #[derive(Serialize,Deserialize,Clone,Debug)] pub struct Programs { @@ -27,6 +20,7 @@ pub struct Programs { } #[derive(Serialize,Deserialize,Clone,Debug,Default)] pub struct LockConf { + pub wallpaper_path: String, pub blur: f32, pub scale: f32, } @@ -34,9 +28,7 @@ pub struct LockConf { pub struct Config { pub title_length: usize, pub window_icons: Vec, - pub wallpaper_path: String, pub programs: HashMap, pub lock: LockConf, - //pub profiles: HashMap - pub profiles: Vec// HashMap + pub profiles: Vec } \ No newline at end of file diff --git a/src/lib/lock.rs b/src/lib/lock.rs index 43fa809..96717c5 100644 --- a/src/lib/lock.rs +++ b/src/lib/lock.rs @@ -32,7 +32,7 @@ pub fn generate_image(orig_img_data: DynamicImage,gen_image_path: PathBuf, lock_ } pub fn lock_screen(config: &Config, mut sway_connection: Connection, force_bg_render: bool) -> Result>, swayipc::Error> { - let wallpaper_root_path = tilde(&config.wallpaper_path).to_string(); + let wallpaper_root_path = tilde(&config.lock.wallpaper_path).to_string(); let wallpaper_root_path = Path::new(&wallpaper_root_path); let cache_dir = BaseDirectories::with_prefix("sway-profiles-rs").cache_home; let wp_cache_dir = cache_dir.clone().unwrap().join("sway-profiles-rs/lock/"); @@ -89,7 +89,7 @@ pub fn lock_screen(config: &Config, mut sway_connection: Connection, force_bg_re } let new_json = json!(wp_hash_array); let _ = write(hashes_json_path, new_json.to_string()); - let mut gtklock_command = "exec echo gtklock".to_owned(); + let mut gtklock_command = "exec gtklock".to_owned(); for a in gtklock_args { gtklock_command = gtklock_command + " " + &a; }