summaryrefslogtreecommitdiffstats
path: root/shared/Theme.qml
diff options
context:
space:
mode:
Diffstat (limited to 'shared/Theme.qml')
-rw-r--r--shared/Theme.qml19
1 files changed, 18 insertions, 1 deletions
diff --git a/shared/Theme.qml b/shared/Theme.qml
index e7f927e..ee432bd 100644
--- a/shared/Theme.qml
+++ b/shared/Theme.qml
@@ -42,7 +42,10 @@ Singleton {
property color mauve: "#c6a0f6"
readonly property string fontFamily: "Noto Sans"
- readonly property int fontSize: 16
+ // The base text size, in px: every size in the shells is this plus or
+ // minus an offset. From the fonts page's fonts.json (Appearance > Fonts),
+ // Quickshell's own override or the desktop-wide base; 16 until then.
+ property int fontSize: 16
// Glyphs are Nerd Font private-use codepoints. They render with this
// family, not fontFamily: fontconfig otherwise falls back per codepoint
@@ -81,4 +84,18 @@ Singleton {
root.mauve = pick("mauve") ?? root.mauve;
}
}
+
+ FileView {
+ path: `${Quickshell.env("XDG_CONFIG_HOME") || Quickshell.env("HOME") + "/.config"}/keystone/fonts.json`
+ watchChanges: true
+ printErrors: false
+ onFileChanged: reload()
+ onLoaded: {
+ try {
+ const j = JSON.parse(text());
+ const px = j.override?.quickshell ?? j.base;
+ if (typeof px === "number" && px >= 8 && px <= 40) root.fontSize = Math.round(px);
+ } catch (e) {}
+ }
+ }
}