Expand description
This applications crate is a library crate that can be used to get a list of installed applications on your system. Support MacOS, and Linux. Windows support will be added soon.
§Examples
ⓘ
let mut ctx = crate::common::AppInfoContext::new();
ctx.refresh_apps().unwrap(); // this will block the thread
let apps = ctx.get_all_apps();
assert!(apps.len() > 0);
ⓘ
use applications::{AppInfoContext, AppInfo};
fn main() {
let mut ctx = AppInfoContext::new();
ctx.refresh_apps().unwrap(); // must refresh apps before getting them
let apps = ctx.get_all_apps();
println!("Apps: {:#?}", apps);
let frontmost_app = ctx.get_frontmost_application().unwrap();
println!("Frontmost App: {:#?}", frontmost_app);
let running_apps = ctx.get_running_apps();
println!("Running Apps: {:#?}", running_apps);
}
Re-exports§
pub use common::App;
pub use common::AppInfo;
pub use common::AppInfoContext;
pub use common::AppTrait;
Modules§
Functions§
- get_
all_ apps - get_
default_ search_ paths - load_
icon - path should be a .png file, Linux icon can also be a .svg file, don’t use this function in that case