diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-17 21:03:26 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-17 21:03:26 +1100 |
| commit | 8751acf68f7ea7748fda338940af02504c597122 (patch) | |
| tree | 37dfa70639482818c52373546c628e95155fd4ef | |
| parent | networks + bluetooth: highlight active (diff) | |
| download | caelestia-shell-8751acf68f7ea7748fda338940af02504c597122.tar.gz caelestia-shell-8751acf68f7ea7748fda338940af02504c597122.tar.bz2 caelestia-shell-8751acf68f7ea7748fda338940af02504c597122.zip | |
style: use system scheme if available
| -rw-r--r-- | app.tsx | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1,4 +1,4 @@ -import { execAsync, GLib, writeFileAsync } from "astal"; +import { execAsync, GLib, readFileAsync, writeFileAsync } from "astal"; import { App } from "astal/gtk3"; import Bar from "./src/modules/bar"; import Launcher from "./src/modules/launcher"; @@ -9,8 +9,12 @@ import Monitors from "./src/services/monitors"; import Players from "./src/services/players"; const loadStyleAsync = async () => { - if (!GLib.file_test(`${SRC}/scss/scheme/_index.scss`, GLib.FileTest.EXISTS)) - await writeFileAsync(`${SRC}/scss/scheme/_index.scss`, '@forward "mocha";'); + let scheme = "mocha"; + if (GLib.file_test(`${CACHE}/scheme/current.txt`, GLib.FileTest.EXISTS)) { + const currentScheme = await readFileAsync(`${CACHE}/scheme/current.txt`); + if (GLib.file_test(`${SRC}/scss/scheme/${scheme}.scss`, GLib.FileTest.EXISTS)) scheme = currentScheme; + } + await writeFileAsync(`${SRC}/scss/scheme/_index.scss`, `@forward "${scheme}";`); App.apply_css(await execAsync(`sass ${SRC}/style.scss`), true); }; |