remove ws, fmt

This commit is contained in:
Damocles 2026-04-11 00:22:09 +02:00
parent 5316f40967
commit cd45c2d9cf
17 changed files with 96 additions and 97 deletions

View file

@ -31,8 +31,7 @@ QtObject {
property int barHeight: 32
property FileView _themeFile: FileView {
path: (Quickshell.env("XDG_CONFIG_HOME") || (Quickshell.env("HOME") + "/.config"))
+ "/nova-shell/theme.json"
path: (Quickshell.env("XDG_CONFIG_HOME") || (Quickshell.env("HOME") + "/.config")) + "/nova-shell/theme.json"
watchChanges: true
onFileChanged: reload()
onLoaded: root._apply(text())
@ -40,14 +39,23 @@ QtObject {
function _apply(raw) {
let data;
try { data = JSON.parse(raw); } catch (e) { return; }
try {
data = JSON.parse(raw);
} catch (e) {
return;
}
const c = data.colors || {};
for (const k of Object.keys(c)) {
if (k in root) root[k] = c[k];
if (k in root)
root[k] = c[k];
}
if (data.fontFamily) root.fontFamily = data.fontFamily;
if (data.fontSize) root.fontSize = data.fontSize;
if (data.barOpacity !== undefined) root.barOpacity = data.barOpacity;
if (data.barHeight !== undefined) root.barHeight = data.barHeight;
if (data.fontFamily)
root.fontFamily = data.fontFamily;
if (data.fontSize)
root.fontSize = data.fontSize;
if (data.barOpacity !== undefined)
root.barOpacity = data.barOpacity;
if (data.barHeight !== undefined)
root.barHeight = data.barHeight;
}
}