forked from Shinonome/dots-hyprland
refactor gamemodetoggle's config option fetching
This commit is contained in:
@@ -3,7 +3,7 @@ pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Hyprland
|
||||
|
||||
import qs.modules.common
|
||||
import qs.modules.common.functions
|
||||
@@ -14,6 +14,8 @@ import qs.modules.common.functions
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
signal reloaded()
|
||||
|
||||
readonly property string configuratorScriptPath: Quickshell.shellPath("scripts/hyprland/hyprconfigurator.py")
|
||||
readonly property string shellOverridesPath: FileUtils.trimFileProtocol(`${Directories.config}/hypr/hyprland/shellOverrides/main.conf`)
|
||||
|
||||
@@ -39,7 +41,7 @@ Singleton {
|
||||
])
|
||||
}
|
||||
|
||||
function resetMany(keys: var) {
|
||||
function resetMany(keys: list<string>) {
|
||||
let args = ""
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
args += `--reset "${keys[i]}" `
|
||||
@@ -48,4 +50,14 @@ Singleton {
|
||||
`${root.configuratorScriptPath} --file ${root.shellOverridesPath} ${args}` //
|
||||
])
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: Hyprland
|
||||
|
||||
function onRawEvent(event) {
|
||||
if (event.name == "configreloaded") {
|
||||
root.reloaded()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user