From f4ffaf9d71aacee33964f3632900a70cf1151fc0 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 7 May 2025 18:23:48 +1000 Subject: feat: launcher light/dark commands --- modules/launcher/Actions.qml | 5 +++-- services/Colours.qml | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/launcher/Actions.qml b/modules/launcher/Actions.qml index e604ae3..8677154 100644 --- a/modules/launcher/Actions.qml +++ b/modules/launcher/Actions.qml @@ -1,6 +1,7 @@ pragma Singleton import "root:/utils/scripts/fuzzysort.js" as Fuzzy +import "root:/services" import "root:/config" import Quickshell import Quickshell.Io @@ -53,7 +54,7 @@ Singleton { function onClicked(list: AppList): void { list.launcher.launcherVisible = false; - // TODO + Colours.setMode("light"); } }, Action { @@ -63,7 +64,7 @@ Singleton { function onClicked(list: AppList): void { list.launcher.launcherVisible = false; - // TODO + Colours.setMode("dark"); } }, Action { diff --git a/services/Colours.qml b/services/Colours.qml index fd0d1f6..dfd2870 100644 --- a/services/Colours.qml +++ b/services/Colours.qml @@ -44,6 +44,15 @@ Singleton { } } + function setMode(mode: string): void { + setModeProc.command = ["caelestia", "scheme", "dynamic", "default", mode]; + setModeProc.startDetached(); + } + + Process { + id: setModeProc + } + FileView { path: `${StandardPaths.standardLocations(StandardPaths.GenericStateLocation)[0]}/caelestia/scheme/current-mode.txt` watchChanges: true -- cgit v1.2.3-freya