style: use system scheme if available
This commit is contained in:
parent
c81616882e
commit
8751acf68f
1 changed files with 7 additions and 3 deletions
10
app.tsx
10
app.tsx
|
|
@ -1,4 +1,4 @@
|
||||||
import { execAsync, GLib, writeFileAsync } from "astal";
|
import { execAsync, GLib, readFileAsync, writeFileAsync } from "astal";
|
||||||
import { App } from "astal/gtk3";
|
import { App } from "astal/gtk3";
|
||||||
import Bar from "./src/modules/bar";
|
import Bar from "./src/modules/bar";
|
||||||
import Launcher from "./src/modules/launcher";
|
import Launcher from "./src/modules/launcher";
|
||||||
|
|
@ -9,8 +9,12 @@ import Monitors from "./src/services/monitors";
|
||||||
import Players from "./src/services/players";
|
import Players from "./src/services/players";
|
||||||
|
|
||||||
const loadStyleAsync = async () => {
|
const loadStyleAsync = async () => {
|
||||||
if (!GLib.file_test(`${SRC}/scss/scheme/_index.scss`, GLib.FileTest.EXISTS))
|
let scheme = "mocha";
|
||||||
await writeFileAsync(`${SRC}/scss/scheme/_index.scss`, '@forward "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);
|
App.apply_css(await execAsync(`sass ${SRC}/style.scss`), true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue