-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test this on macOS #2
Comments
Hi! I tried to build this on MacOS (Sonoma 14.3, rust 1.75.0):
But then, running
Looks like this file needs to import |
It seems like wallpaper.rs has a few issues on OS X. Apologies for the raw diff, but here's a quick and dirty set of changes to what I did to get it to build with 1.76.0-nightly (after installing LLVM). index c94ce0a..ad2442d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,6 +14,7 @@ license = "Unlicense"
dirs = { version = "1", optional = true }
thiserror = "1"
reqwest = { version = "0.11", optional = true, features = ["blocking"] }
+rust-ini = "0.12"
[target.'cfg(unix)'.dependencies]
enquote = "1"
diff --git a/src/macos.rs b/src/macos.rs
index 06f74b5..ed85584 100644
--- a/src/macos.rs
+++ b/src/macos.rs
@@ -1,4 +1,5 @@
-use crate::{get_stdout, run, Mode, Result};
+use crate::{get_stdout, run, Result};
+use std::path::Path;
#[cfg(feature = "from_url")]
use crate::download_image;
@@ -19,13 +20,14 @@ pub fn set_from_path<P>(path: P) -> Result<()>
where
P: AsRef<Path> + std::fmt::Display,
{
+ let path_str = path.to_string(); // Convert path to a string
run(
"osascript",
&[
"-e",
&format!(
r#"tell application "System Events" to tell every desktop to set picture to {}"#,
- enquote::enquote('"', path),
+ enquote::enquote('"', &path_str),
),
],
)
@@ -38,7 +40,3 @@ pub fn set_from_url(url: &str) -> Result<()> {
set_from_path(&path)
}
-/// No-op. Unable to change with AppleScript.
-pub fn set_mode(_: Mode) -> Result<()> {
- Err("unsupported on macos".into())
-}``` |
All that said, everything does build and work, nice work! |
Thanks @anna-hope and @jacobbarssbailey for testing it out! In #7, I added a GitHub action that builds the project on macOS, and I think it is working now. If this was the only problem, I will close this issue. @jacobbarssbailey, there appears to be a problem with handling DPI scaling (I don't remember if I am handling it at all). I will create another issue about that. |
I don't have a macOS to test this on, so I cannot ensure that this is working there. But as far as I know, All crates used support macOS.
The text was updated successfully, but these errors were encountered: