Skip to content

Commit

Permalink
foo
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyTurtleDev committed Feb 19, 2024
1 parent 03c0073 commit e67547b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions more-wallpapers/src/linux/xfce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub(crate) fn get_screens() -> Result<Vec<Screen>, WallpaperError> {
}

pub(crate) fn set_screens(screens: Vec<Screen>) -> Result<(), WallpaperError> {
fn set_key<P: AsRef<OsStr>>(key: String, property: P) -> Result<(), WallpaperError> {
fn set_key<P: AsRef<OsStr>>(key: &str, property: P) -> Result<(), WallpaperError> {
let mut command = Command::new("xfconf-query");
command
.args(["--channel", "xfce4-desktop", "-p"])
Expand All @@ -90,9 +90,10 @@ pub(crate) fn set_screens(screens: Vec<Screen>) -> Result<(), WallpaperError> {
Ok(())
}

//set_key("/backdrop/single-workspace-mode", "false")?; //force different wallpaper per workscreen
for screen in screens {
let key = format!("/backdrop/{}/last-image", screen.name);
set_key(key, &screen.wallpaper.unwrap())?;
set_key(&key, &screen.wallpaper.unwrap())?;
let mode: u8 = match screen.mode.unwrap() {
Mode::Center => 1,
Mode::Tile => 2,
Expand All @@ -101,7 +102,7 @@ pub(crate) fn set_screens(screens: Vec<Screen>) -> Result<(), WallpaperError> {
Mode::Crop => 5,
};
let key = format!("/backdrop/{}/image-style", screen.name);
set_key(key, format!("{mode}"))?;
set_key(&key, format!("{mode}"))?;
}
Ok(())
}

0 comments on commit e67547b

Please sign in to comment.