use std::process::Command;
#[link(name = "ApplicationServices", kind = "framework")]
extern "C" {
fn AXIsProcessTrusted() -> bool;
}
pub fn check_accessibility() -> bool {
unsafe { AXIsProcessTrusted() }
}
pub fn open_accessibility_settings() -> std::io::Result<()> {
Command::new("open")
.arg("x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility")
.spawn()?
.wait()?;
Ok(())
}