about summary refs log blame commit diff
path: root/users/tazjin/gio-list-apps/src/main.rs
blob: c6b6b98d4d9cf1a3c360934bc053bba787dc5458 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                    
                                                                    






                                           
use gio::traits::AppInfoExt;
use gio::AppInfo;
use serde_json::json;

fn main() {
    for app in AppInfo::all() {
        if app.should_show() {
            if let Some(cmd) = app.commandline() {
                println!(
                    "{}",
                    json!({
                        "name": app.name().as_str(),
                        "display_name": app.display_name().as_str(),
                        "commandline": cmd,
                    })
                );
            }
        }
    }
}