about summary refs log tree commit diff
path: root/users/tazjin/gio-list-apps/src/main.rs
blob: 2b04ac06a7540218546b11678da969ee91f17864 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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(),
                        "commandline": cmd,
                    })
                );
            }
        }
    }
}