summaryrefslogtreecommitdiff
path: root/modules/launcher/M3Variants.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-17 16:20:47 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-17 16:20:47 +1000
commit746f41da16ddc463345948110d0a75a68918af90 (patch)
treecaf925b02b6fcada02e4f96bcff932b725db6d8d /modules/launcher/M3Variants.qml
parentinternal: use execDetached (diff)
downloadcaelestia-shell-746f41da16ddc463345948110d0a75a68918af90.tar.gz
caelestia-shell-746f41da16ddc463345948110d0a75a68918af90.tar.bz2
caelestia-shell-746f41da16ddc463345948110d0a75a68918af90.zip
feat: impl variant launcher action
Diffstat (limited to 'modules/launcher/M3Variants.qml')
-rw-r--r--modules/launcher/M3Variants.qml91
1 files changed, 91 insertions, 0 deletions
diff --git a/modules/launcher/M3Variants.qml b/modules/launcher/M3Variants.qml
new file mode 100644
index 0000000..a4b797a
--- /dev/null
+++ b/modules/launcher/M3Variants.qml
@@ -0,0 +1,91 @@
+pragma Singleton
+
+import "root:/utils/scripts/fuzzysort.js" as Fuzzy
+import "root:/config"
+import Quickshell
+import QtQuick
+
+Singleton {
+ id: root
+
+ readonly property list<Variant> list: [
+ Variant {
+ variant: "vibrant"
+ icon: "sentiment_very_dissatisfied"
+ name: "Vibrant"
+ description: "A high chroma palette. The primary palette's chroma is at maximum."
+ },
+ Variant {
+ variant: "tonalspot"
+ icon: "android"
+ name: "Tonal Spot"
+ description: "Default for Material theme colours. A pastel palette with a low chroma."
+ },
+ Variant {
+ variant: "expressive"
+ icon: "compare_arrows"
+ name: "Expressive"
+ description: "A medium chroma palette. The primary palette's hue is different from the seed colour, for variety."
+ },
+ Variant {
+ variant: "fidelity"
+ icon: "compare"
+ name: "Fidelity"
+ description: "Matches the seed colour, even if the seed colour is very bright (high chroma)."
+ },
+ Variant {
+ variant: "content"
+ icon: "sentiment_calm"
+ name: "Content"
+ description: "Almost identical to fidelity."
+ },
+ Variant {
+ variant: "fruitsalad"
+ icon: "nutrition"
+ name: "Fruit Salad"
+ description: "A playful theme - the seed colour's hue does not appear in the theme."
+ },
+ Variant {
+ variant: "rainbow"
+ icon: "looks"
+ name: "Rainbow"
+ description: "A playful theme - the seed colour's hue does not appear in the theme."
+ },
+ Variant {
+ variant: "neutral"
+ icon: "contrast"
+ name: "Neutral"
+ description: "Close to grayscale, a hint of chroma."
+ },
+ Variant {
+ variant: "monochrome"
+ icon: "filter_b_and_w"
+ name: "Monochrome"
+ description: "All colours are grayscale, no chroma."
+ }
+ ]
+
+ readonly property list<var> preppedVariants: list.map(v => ({
+ name: Fuzzy.prepare(v.variant),
+ variant: v
+ }))
+
+ function fuzzyQuery(search: string): var {
+ return Fuzzy.go(search.slice(`${Config.launcher.actionPrefix}variant `.length), preppedVariants, {
+ all: true,
+ key: "name"
+ }).map(r => r.obj.variant);
+ }
+
+ component Variant: QtObject {
+ required property string variant
+ required property string icon
+ required property string name
+ required property string description
+
+ function onClicked(list: AppList): void {
+ list.visibilities.launcher = false;
+ Quickshell.execDetached(["caelestia", "scheme", "set", "-v", variant]);
+ }
+ }
+}