Compare commits

..

No commits in common. "502f1e89a5d493e7bafb80e53b3b6e3beaa79e50" and "b07d92188070e223e1585d3f9a0635fcedfe4b0f" have entirely different histories.

5 changed files with 13 additions and 12 deletions

View File

@ -4,7 +4,7 @@ use core::fmt;
use crate::enums::*;
use untildify;
#[derive(Debug, Clone)]
#[derive(Debug)]
pub struct Monitors {
pub monitors: Vec<MonitorType>,
}
@ -29,7 +29,7 @@ impl fmt::Display for Monitors {
}
}
#[derive(Debug, Clone)]
#[derive(Debug)]
pub struct WallpaperDir {
ultrawide: String,
horizontal: String,
@ -68,7 +68,7 @@ impl fmt::Display for WallpaperDir {
}
}
#[derive(Debug, Clone)]
#[derive(Debug)]
pub struct Config {
pub x_server: String,
pub wallpaper_engine: WallpaperHandler,

View File

@ -1,6 +1,6 @@
use core::fmt;
#[derive(Debug, Clone)]
#[derive(Debug)]
pub enum WallpaperHandler {
Feh,
Plasma,

View File

@ -6,7 +6,7 @@ use std::fmt::Write as _;
use crate::config::*;
use crate::enums::*;
#[derive(Debug, Clone)]
#[derive(Debug)]
pub struct Wallpaper {
path: String,
}
@ -23,7 +23,7 @@ impl fmt::Display for Wallpaper {
}
}
#[derive(Debug, Clone)]
#[derive(Debug)]
pub struct Wallpapers {
ultrawide: Vec<Wallpaper>,
horizontal: Vec<Wallpaper>,
@ -32,12 +32,14 @@ pub struct Wallpapers {
}
impl Wallpapers {
pub fn new(config: Config) -> Wallpapers {
pub fn new() -> Wallpapers {
Wallpapers {
ultrawide: vec![],
horizontal: vec![],
vertical: vec![],
config,
config: Config::from_config(
"/home/ben/.config/wallpaperctl/wallpaperctl.ini".to_owned(),
),
}
}

View File

@ -1,3 +1,4 @@
use crate::config::Monitors;
use crate::handlers::dbus_plasma_interface;
use crate::Wallpapers;
@ -22,7 +23,7 @@ pub fn change_wallpapers(wallpapers: &Wallpapers) {
let javascript = generate_js(wallpapers);
let resp = proxy.evaluate_script(javascript.as_ref());
match resp {
Ok(_str) => {}
Ok(str) => {}
Err(e) => println!("{}", e),
}
}

View File

@ -1,13 +1,11 @@
mod config;
use config::*;
mod enums;
mod files;
use files::*;
mod handlers;
fn main() {
let config = Config::from_config("/home/ben/.config/wallpaperctl/wallpaperctl.ini".to_owned());
let mut wallpapers = Wallpapers::new(config.clone());
let mut wallpapers = Wallpapers::new();
wallpapers.load_all();
handlers::plasma::change_wallpapers(&wallpapers);