Add effective desktop style controls
This commit is contained in:
@@ -25,25 +25,14 @@ import qs.config
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
property string cursorTheme: ""
|
||||
property string lastError: ""
|
||||
|
||||
readonly property bool busy: themeQuery.running || runner.running || root.pending.length > 0
|
||||
readonly property bool busy: runner.running || root.pending.length > 0
|
||||
|
||||
readonly property string cursorTheme: DesktopPreferences.get("cursorTheme")
|
||||
readonly property int cursorSize: DesktopPreferences.get("cursorSize")
|
||||
readonly property real textScale: DesktopPreferences.get("textScale")
|
||||
|
||||
Process {
|
||||
id: themeQuery
|
||||
command: ["gsettings", "get", "org.gnome.desktop.interface", "cursor-theme"]
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
// gsettings quotes strings: 'oreo_blue_cursors'
|
||||
root.cursorTheme = this.text.trim().replace(/^'|'$/g, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A short queue, because applying one setting takes several commands and
|
||||
// Process runs one at a time.
|
||||
property var pending: []
|
||||
@@ -71,7 +60,6 @@ Singleton {
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
themeQuery.running = true;
|
||||
settle.restart();
|
||||
}
|
||||
|
||||
@@ -102,10 +90,7 @@ Singleton {
|
||||
["gsettings", "set", "org.gnome.desktop.interface", "cursor-size", size],
|
||||
["gsettings", "set", "org.gnome.desktop.interface", "text-scaling-factor", String(root.textScale)]
|
||||
];
|
||||
// setcursor needs a theme name; skip it rather than guess if gsettings
|
||||
// has not answered yet. The next change will catch up.
|
||||
if (root.cursorTheme !== "")
|
||||
commands.push(["hyprctl", "setcursor", root.cursorTheme, size]);
|
||||
commands.push(["hyprctl", "setcursor", root.cursorTheme, size]);
|
||||
root.enqueue(commands);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user