diff --git a/Cargo.toml b/Cargo.toml index fab7724..618ffb4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,8 +13,8 @@ keywords = ["display", "settings", "cli"] categories = ["command-line-utilities", "config"] [features] -linux-wayland = [ "wayland-client", "wayland-protocols-wlr" ] -linux-x11 = [] +unix-wayland = [ "wayland-client", "wayland-protocols-wlr" ] +unix-x11 = [] [dependencies] color-eyre = "0.6.2" diff --git a/src/lib.rs b/src/lib.rs index a0132b9..9e8b3f8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,7 @@ target_os = "netbsd", target_os = "openbsd" ), - path = "platforms/linux/mod.rs" + path = "platforms/unix/mod.rs" )] #[cfg_attr(target_os = "windows", path = "platforms/windows/mod.rs")] #[cfg_attr(target_os = "macos", path = "platforms/macos/mod.rs")] diff --git a/src/platforms/linux/mod.rs b/src/platforms/linux/mod.rs deleted file mode 100644 index 1e0c753..0000000 --- a/src/platforms/linux/mod.rs +++ /dev/null @@ -1,21 +0,0 @@ -#[cfg(any( - all(target_os = "linux", feature = "linux-x11"), - target_os = "dragonfly", - target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd"))] -mod x11; - -#[cfg(any( - all(target_os = "linux", feature = "linux-x11"), - target_os = "dragonfly", - target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd"))] -pub use x11::*; - -#[cfg(all(target_os = "linux", feature = "linux-wayland"))] -mod wayland; - -#[cfg(all(target_os = "linux", feature = "linux-wayland"))] -pub use wayland::*; diff --git a/src/platforms/unix/mod.rs b/src/platforms/unix/mod.rs new file mode 100644 index 0000000..3413bc7 --- /dev/null +++ b/src/platforms/unix/mod.rs @@ -0,0 +1,11 @@ +#[cfg(feature = "unix-x11")] +mod x11; + +#[cfg(feature = "unix-x11")] +pub use x11::*; + +#[cfg(feature = "unix-wayland")] +mod wayland; + +#[cfg(feature = "unix-wayland")] +pub use wayland::*; diff --git a/src/platforms/linux/wayland/mod.rs b/src/platforms/unix/wayland/mod.rs similarity index 100% rename from src/platforms/linux/wayland/mod.rs rename to src/platforms/unix/wayland/mod.rs diff --git a/src/platforms/linux/x11/mod.rs b/src/platforms/unix/x11/mod.rs similarity index 100% rename from src/platforms/linux/x11/mod.rs rename to src/platforms/unix/x11/mod.rs