diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-23 16:53:15 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-23 16:53:15 +1000 |
| commit | f52fb9bd9ee73d785c5a7141c1924a89e05f212a (patch) | |
| tree | 5fdc891ac229e026c83575359c36d884bf1060f2 /modules/launcher/services | |
| parent | launcher: add random wallpaper action (diff) | |
| download | caelestia-shell-f52fb9bd9ee73d785c5a7141c1924a89e05f212a.tar.gz caelestia-shell-f52fb9bd9ee73d785c5a7141c1924a89e05f212a.tar.bz2 caelestia-shell-f52fb9bd9ee73d785c5a7141c1924a89e05f212a.zip | |
launcher: show current scheme/variant
Also qsTr variant stuff
Diffstat (limited to 'modules/launcher/services')
| -rw-r--r-- | modules/launcher/services/M3Variants.qml | 36 | ||||
| -rw-r--r-- | modules/launcher/services/Schemes.qml | 23 |
2 files changed, 40 insertions, 19 deletions
diff --git a/modules/launcher/services/M3Variants.qml b/modules/launcher/services/M3Variants.qml index 9232883..963a4d4 100644 --- a/modules/launcher/services/M3Variants.qml +++ b/modules/launcher/services/M3Variants.qml @@ -17,56 +17,56 @@ Searcher { Variant { variant: "vibrant" icon: "sentiment_very_dissatisfied" - name: "Vibrant" - description: "A high chroma palette. The primary palette's chroma is at maximum." + name: qsTr("Vibrant") + description: qsTr("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." + name: qsTr("Tonal Spot") + description: qsTr("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." + name: qsTr("Expressive") + description: qsTr("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)." + name: qsTr("Fidelity") + description: qsTr("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." + name: qsTr("Content") + description: qsTr("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." + name: qsTr("Fruit Salad") + description: qsTr("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." + name: qsTr("Rainbow") + description: qsTr("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." + name: qsTr("Neutral") + description: qsTr("Close to grayscale, a hint of chroma.") }, Variant { variant: "monochrome" icon: "filter_b_and_w" - name: "Monochrome" - description: "All colours are grayscale, no chroma." + name: qsTr("Monochrome") + description: qsTr("All colours are grayscale, no chroma.") } ] useFuzzy: Config.launcher.useFuzzy.variants diff --git a/modules/launcher/services/Schemes.qml b/modules/launcher/services/Schemes.qml index a5891d5..dbb2dac 100644 --- a/modules/launcher/services/Schemes.qml +++ b/modules/launcher/services/Schemes.qml @@ -10,6 +10,9 @@ import QtQuick Searcher { id: root + property string currentScheme + property string currentVariant + function transformSearch(search: string): string { return search.slice(`${Config.launcher.actionPrefix}scheme `.length); } @@ -18,6 +21,10 @@ Searcher { return `${item.name} ${item.flavour}`; } + function reload(): void { + getCurrent.running = true; + } + list: schemes.instances useFuzzy: Config.launcher.useFuzzy.schemes keys: ["name", "flavour"] @@ -48,7 +55,21 @@ Searcher { for (const f of s) flat.push(f); - schemes.model = flat; + schemes.model = flat.sort((a, b) => (a.name + a.flavour).localeCompare((b.name + b.flavour))); + } + } + } + + Process { + id: getCurrent + + running: true + command: ["caelestia", "scheme", "get", "-nfv"] + stdout: StdioCollector { + onStreamFinished: { + const [name, flavour, variant] = text.trim().split("\n"); + root.currentScheme = `${name} ${flavour}`; + root.currentVariant = variant; } } } |