Expand description
§mado (窓)
macOS active app and window monitoring with browser metadata.
mado wraps native macOS APIs through Swift. Use it to query the active
app and focused window, listen to focus changes, extract browser URL metadata,
and scan installed apps from Rust.
§Quick Start
§Query current state
let app = mado::get_active_app()?;
println!("Current app: {}", app);
let window = mado::get_active_window()?;
println!("Window: {}", window);§Monitor changes
use mado::{WindowListener, WindowMonitor, WindowEvent};
struct MyListener;
impl WindowListener for MyListener {
fn on_focus_change(&self, event: WindowEvent) {
match event {
WindowEvent::AppActivated { app } => {
println!("App: {}", app);
}
WindowEvent::WindowChanged { window } => {
println!("Window: {}", window);
}
}
}
}
let monitor = WindowMonitor::new(MyListener);
monitor.run()?;§Platform Support
- macOS: supported
- Linux: planned
- Windows: planned
§Requirements
macOS:
- Accessibility permissions required if
track_window_changes: true(default)
Re-exports§
pub use config::InstalledAppsConfig;pub use config::MonitorConfig;pub use config::QueryConfig;pub use error::Error;pub use listener::WindowListener;pub use monitor::WindowMonitor;pub use types::AppIcon;pub use types::AppInfo;pub use types::BrowserInfo;pub use types::InstalledApp;pub use types::WebsiteIcon;pub use types::WebsiteInfo;pub use types::WindowBounds;pub use types::WindowEvent;pub use types::WindowInfo;
Modules§
Functions§
- get_
active_ app - Get information about the currently active application
- get_
active_ app_ with_ config - Get information about the currently active application with custom configuration.
- get_
active_ window - Get information about the currently active window.
- get_
active_ window_ with_ config - Get information about the currently active window with custom configuration.
- get_
app_ color - Get the display color for a specific app by bundle identifier.
- get_
app_ icon - Get icon for a specific app by bundle identifier.
- get_
installed_ apps - Get all installed applications on the system.
- get_
website_ icon - Get favicon for a website URL.
- is_
accessibility_ trusted - Check if accessibility permissions are granted (macOS only)