Crate applications

Source
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§

api
common
Common Data Structures
prelude
utils

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