Skip to content

Commit

Permalink
add missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyTurtleDev committed Feb 15, 2024
1 parent 89e03e0 commit 855d222
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions more-wallpapers/src/linux/xfce.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
use crate::{error::CommandError, load_env_var, Environment, WallpaperBuilder, WallpaperError};
use crate::Screen;
use super::check_command_error;
use std::process::Command;

fn load_property(property: &str) -> Result<String, WallpaperError> {
let mut command = Command::new("xfconf-query");
command.args(["--channel", "xfce4-desktop", "p"]);
command.arg(property);
let output = check_command_error(command.output(), "xfconf-query")?;
let output = String::from_utf8(output).unwrap();
Ok(output)
}


pub(crate) fn get_screens() -> Result<Vec<Screen>, WallpaperError> {
let mut command = Command::new("xfconf-query");
command.args(["--channel", "xfce4-desktop", "--list"]);
let output = check_command_error(command.output(), "xfconf-query")?;
let output = String::from_utf8(output).unwrap();
let mut current_screen_wallpaper = None;
let mut current_screen_mode = None;
for line in output.lines() {
if line.starts_with("/backdrop/") {
break;
}
if line.ends_with("/image-style"){
let value = load_property(line)?;
current_screen_mode.is_some panic
current_screen_mode = Some(("screenname_TODO".to_owned(), value));

}
if line.ends_with("/last-image"){
let value = load_property(line)?;
current_screen_mode.unwrap() = "screenname_TODO";
current_screen_wallpaper.is_some panic
current_screen_wallpaper = Some(("screenname_TODO".to_owned(), value));
}
}
todo!()
}

0 comments on commit 855d222

Please sign in to comment.