Skip to content

Commit

Permalink
fix: "support" non linux systems in display.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
damaredayo committed May 28, 2024
1 parent e031202 commit 102275e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ferrisfetch"
version = "0.3.0"
version = "0.3.1"
edition = "2021"

[dependencies]
Expand Down
9 changes: 7 additions & 2 deletions src/modules/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;

impl State {
pub fn fetch_display(&self) -> Vec<String> {
fetch_x11_display().unwrap_or_else(|_| Vec::new())
#[cfg(target_os = "linux")]
return fetch_x11_display().unwrap_or_else(|_| Vec::new());

#[cfg(not(target_os = "linux"))]
return Vec::new();

}
}


#[cfg(target_os = "linux")]
fn fetch_x11_display() -> Result<Vec<String>> {
let mut displays = Vec::new();

Expand Down

0 comments on commit 102275e

Please sign in to comment.