config: add config for disabling smart scheme

Closes #408
This commit is contained in:
2 * r + 2 * t 2025-08-13 16:25:26 +10:00
parent d84a52f063
commit a10054db21
3 changed files with 6 additions and 3 deletions

View file

@ -306,7 +306,8 @@ All configuration options are in `~/.config/caelestia/shell.json`.
"audioIncrement": 0.1, "audioIncrement": 0.1,
"weatherLocation": "10,10", "weatherLocation": "10,10",
"useFahrenheit": false, "useFahrenheit": false,
"useTwelveHourClock": false "useTwelveHourClock": false,
"smartScheme": true
}, },
"session": { "session": {
"dragThreshold": 30, "dragThreshold": 30,

View file

@ -6,4 +6,5 @@ JsonObject {
property bool useFahrenheit: [Locale.ImperialUSSystem, Locale.ImperialSystem].includes(Qt.locale().measurementSystem) property bool useFahrenheit: [Locale.ImperialUSSystem, Locale.ImperialSystem].includes(Qt.locale().measurementSystem)
property bool useTwelveHourClock: Qt.locale().timeFormat(Locale.ShortFormat).toLowerCase().includes("a") property bool useTwelveHourClock: Qt.locale().timeFormat(Locale.ShortFormat).toLowerCase().includes("a")
property real audioIncrement: 0.1 property real audioIncrement: 0.1
property bool smartScheme: true
} }

View file

@ -10,6 +10,7 @@ Searcher {
id: root id: root
readonly property string currentNamePath: Paths.strip(`${Paths.state}/wallpaper/path.txt`) readonly property string currentNamePath: Paths.strip(`${Paths.state}/wallpaper/path.txt`)
readonly property list<string> smartArg: Config.services.smartScheme ? [] : ["--no-smart"]
property bool showPreview: false property bool showPreview: false
readonly property string current: showPreview ? previewPath : actualCurrent readonly property string current: showPreview ? previewPath : actualCurrent
@ -19,7 +20,7 @@ Searcher {
function setWallpaper(path: string): void { function setWallpaper(path: string): void {
actualCurrent = path; actualCurrent = path;
Quickshell.execDetached(["caelestia", "wallpaper", "-f", path]); Quickshell.execDetached(["caelestia", "wallpaper", "-f", path, ...smartArg]);
} }
function preview(path: string): void { function preview(path: string): void {
@ -73,7 +74,7 @@ Searcher {
Process { Process {
id: getPreviewColoursProc id: getPreviewColoursProc
command: ["caelestia", "wallpaper", "-p", root.previewPath] command: ["caelestia", "wallpaper", "-p", root.previewPath, ...root.smartArg]
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
Colours.load(text, true); Colours.load(text, true);