From 91b53bfbbbe7cdf9918c48c71fed784281621649 Mon Sep 17 00:00:00 2001
From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Date: Sun, 26 Jan 2025 17:13:12 +1100
Subject: launcher: scheme subcommand

---
 src/modules/launcher.tsx | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

(limited to 'src/modules/launcher.tsx')

diff --git a/src/modules/launcher.tsx b/src/modules/launcher.tsx
index 5c820ff..e75f39f 100644
--- a/src/modules/launcher.tsx
+++ b/src/modules/launcher.tsx
@@ -473,6 +473,22 @@ const Results = ({ entry, mode }: { entry: Widget.Entry; mode: Variable<Mode> })
                             description: "Manage open windows",
                             command: () => mode.set("windows"),
                         },
+                        scheme: {
+                            icon: "palette",
+                            name: "Scheme",
+                            description: "Change the current colour scheme",
+                            command: (...args) => {
+                                // If no args, autocomplete cmd
+                                if (args.length === 0) {
+                                    entry.set_text(">scheme ");
+                                    entry.set_position(-1);
+                                    return true;
+                                }
+
+                                execAsync(`caelestia scheme ${args[0]}`).catch(console.error);
+                                close(self);
+                            },
+                        },
                         todo: {
                             icon: "checklist",
                             name: "Todo",
-- 
cgit v1.2.3-freya

