Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyTurtleDev committed Oct 24, 2023
1 parent 425d575 commit 12b817a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions more-wallpapers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ impl From<Mode> for fallback::Mode {
pub enum Environment {
Cinnamon,
Kde,
Sway,
#[cfg(feature = "fallback")]
LinuxFallback,
#[cfg(feature = "fallback")]
Expand Down
5 changes: 4 additions & 1 deletion more-wallpapers/src/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::{ffi::OsStr, process, process::Command};
mod cinnamon;
mod kde;
mod x11;
mod sway;

#[cfg(feature = "fallback")]
mod wallpaper_crate;
Expand All @@ -14,7 +15,7 @@ fn get_environment() -> Result<Environment, WallpaperError> {
//if the SWAYSOCK env exist sawy is the active desktop
let sway_sock = load_env_var("SWAYSOCK");
if sway_sock.is_ok() {
return Ok(Environment::LinuxFallback);
return Ok(Environment::Sway);
}
}
let desktop = load_env_var("XDG_CURRENT_DESKTOP")?.to_lowercase();
Expand All @@ -41,6 +42,7 @@ pub(crate) fn get_builder() -> Result<WallpaperBuilder, WallpaperError> {
let screens = match environment {
Environment::Cinnamon => cinnamon::get_screens()?,
Environment::Kde => kde::get_screens()?,
Environment::Sway => sway::get_screens()?,
Environment::X11 => x11::get_screens()?,
#[cfg(feature = "fallback")]
Environment::LinuxFallback => wallpaper_crate::get_screens(),
Expand All @@ -56,6 +58,7 @@ pub(crate) fn set_screens_from_builder(builder: WallpaperBuilder) -> Result<(),
match builder.environment {
Environment::Cinnamon => cinnamon::set_screens(builder.screens)?,
Environment::Kde => kde::set_screens(builder.screens)?,
Environment::Sway => sway::set_screens(builder.screens)?,
Environment::X11 => x11::set_screens(builder.screens)?,
#[cfg(feature = "fallback")]
Environment::LinuxFallback => wallpaper_crate::set_screens(builder.screens)?,
Expand Down

0 comments on commit 12b817a

Please sign in to comment.