summaryrefslogtreecommitdiff
path: root/src/modules/launcher/actions.tsx
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-03-05 19:25:49 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-03-05 19:25:49 +1100
commitab80d8f78681ac46e19ad97e152b7d5afe1bf999 (patch)
tree8989038f53e89f80c27b80c824cb6a12c7fae10c /src/modules/launcher/actions.tsx
parentupdates: fix escaping markup (diff)
downloadcaelestia-shell-ab80d8f78681ac46e19ad97e152b7d5afe1bf999.tar.gz
caelestia-shell-ab80d8f78681ac46e19ad97e152b7d5afe1bf999.tar.bz2
caelestia-shell-ab80d8f78681ac46e19ad97e152b7d5afe1bf999.zip
launcher: fixes
Fix light/dark actions Fix delay when pressing enter
Diffstat (limited to 'src/modules/launcher/actions.tsx')
-rw-r--r--src/modules/launcher/actions.tsx14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/modules/launcher/actions.tsx b/src/modules/launcher/actions.tsx
index c45273d..ffbd4b1 100644
--- a/src/modules/launcher/actions.tsx
+++ b/src/modules/launcher/actions.tsx
@@ -29,12 +29,6 @@ const autocomplete = (entry: Widget.Entry, action: string) => {
entry.set_position(-1);
};
-const hasMode = (mode: "light" | "dark") => {
- const scheme = Schemes.get_default().map[Palette.get_default().scheme];
- if (scheme.colours?.[mode]) return true;
- return scheme.flavours?.[Palette.get_default().flavour ?? ""]?.colours?.[mode] !== undefined;
-};
-
const actions = (mode: Variable<Mode>, entry: Widget.Entry): ActionMap => ({
apps: {
icon: "apps",
@@ -77,20 +71,20 @@ const actions = (mode: Variable<Mode>, entry: Widget.Entry): ActionMap => ({
name: "Light",
description: "Change scheme to light mode",
action: () => {
- execAsync(`caelestia wallpaper -T light -f ${STATE}/wallpaper/current`).catch(console.error);
+ Palette.get_default().switchMode("light");
close();
},
- available: () => hasMode("light"),
+ available: () => Palette.get_default().hasMode("light"),
},
dark: {
icon: "dark_mode",
name: "Dark",
description: "Change scheme to dark mode",
action: () => {
- execAsync(`caelestia wallpaper -T dark -f ${STATE}/wallpaper/current`).catch(console.error);
+ Palette.get_default().switchMode("dark");
close();
},
- available: () => hasMode("dark"),
+ available: () => Palette.get_default().hasMode("dark"),
},
scheme: {
icon: "palette",