Files
dotfiles/fedora/quickshell/control-center/Settings.qml
2026-07-25 12:38:39 +03:00

37 lines
991 B
QML

import QtQuick
import Quickshell
import Quickshell.Io
QtObject {
id: root
property alias temperatureInterval: values.temperatureInterval
property alias temperatureWarning: values.temperatureWarning
property alias temperatureCritical: values.temperatureCritical
function setTemperatureWarning(value) {
root.temperatureWarning = Math.min(value, root.temperatureCritical - 1);
}
function setTemperatureCritical(value) {
root.temperatureCritical = Math.max(value, root.temperatureWarning + 1);
}
property FileView settingsFile: FileView {
path: Quickshell.statePath("control-center.json")
printErrors: false
watchChanges: true
onFileChanged: reload()
onAdapterUpdated: writeAdapter()
JsonAdapter {
id: values
property int temperatureInterval: 2000
property int temperatureWarning: 75
property int temperatureCritical: 90
}
}
}