about summary refs log tree commit diff
path: root/users/tazjin/gio-list-apps/src
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin/gio-list-apps/src')
-rw-r--r--users/tazjin/gio-list-apps/src/main.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/users/tazjin/gio-list-apps/src/main.rs b/users/tazjin/gio-list-apps/src/main.rs
new file mode 100644
index 000000000000..2b04ac06a754
--- /dev/null
+++ b/users/tazjin/gio-list-apps/src/main.rs
@@ -0,0 +1,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,
+                    })
+                );
+            }
+        }
+    }
+}