internal: create service config
This commit is contained in:
parent
672a373637
commit
f263df3ccd
6 changed files with 12 additions and 6 deletions
|
|
@ -16,6 +16,7 @@ Singleton {
|
||||||
property alias session: adapter.session
|
property alias session: adapter.session
|
||||||
property alias winfo: adapter.winfo
|
property alias winfo: adapter.winfo
|
||||||
property alias lock: adapter.lock
|
property alias lock: adapter.lock
|
||||||
|
property alias services: adapter.services
|
||||||
property alias paths: adapter.paths
|
property alias paths: adapter.paths
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
|
|
@ -36,6 +37,7 @@ Singleton {
|
||||||
property JsonObject session: SessionConfig {}
|
property JsonObject session: SessionConfig {}
|
||||||
property JsonObject winfo: WInfoConfig {}
|
property JsonObject winfo: WInfoConfig {}
|
||||||
property JsonObject lock: LockConfig {}
|
property JsonObject lock: LockConfig {}
|
||||||
|
property JsonObject services: ServiceConfig {}
|
||||||
property JsonObject paths: UserPaths {}
|
property JsonObject paths: UserPaths {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@ import Quickshell.Io
|
||||||
JsonObject {
|
JsonObject {
|
||||||
property int mediaUpdateInterval: 500
|
property int mediaUpdateInterval: 500
|
||||||
property int visualiserBars: 45
|
property int visualiserBars: 45
|
||||||
property string weatherLocation: "" // A lat,long pair, e.g. "37.8267,-122.4233"
|
|
||||||
property bool useFahrenheit: false
|
|
||||||
|
|
||||||
property JsonObject sizes: JsonObject {
|
property JsonObject sizes: JsonObject {
|
||||||
readonly property int tabIndicatorHeight: 3
|
readonly property int tabIndicatorHeight: 3
|
||||||
|
|
|
||||||
6
config/ServiceConfig.qml
Normal file
6
config/ServiceConfig.qml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
import Quickshell.Io
|
||||||
|
|
||||||
|
JsonObject {
|
||||||
|
property string weatherLocation: "" // A lat,long pair or empty for autodetection, e.g. "37.8267,-122.4233"
|
||||||
|
property bool useFahrenheit: false
|
||||||
|
}
|
||||||
|
|
@ -38,7 +38,7 @@ Item {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
animate: true
|
animate: true
|
||||||
text: Config.dashboard.useFahrenheit ? Weather.tempF : Weather.tempC
|
text: Config.services.useFahrenheit ? Weather.tempF : Weather.tempC
|
||||||
color: Colours.palette.m3primary
|
color: Colours.palette.m3primary
|
||||||
font.pointSize: Appearance.font.size.extraLarge
|
font.pointSize: Appearance.font.size.extraLarge
|
||||||
font.weight: 500
|
font.weight: 500
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ RowLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
animate: true
|
animate: true
|
||||||
text: Config.dashboard.useFahrenheit ? Weather.tempF : Weather.tempC
|
text: Config.services.useFahrenheit ? Weather.tempF : Weather.tempC
|
||||||
color: Colours.palette.m3primary
|
color: Colours.palette.m3primary
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
font.pointSize: Appearance.font.size.extraLarge
|
font.pointSize: Appearance.font.size.extraLarge
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ Singleton {
|
||||||
property string tempF: "0°F"
|
property string tempF: "0°F"
|
||||||
|
|
||||||
function reload(): void {
|
function reload(): void {
|
||||||
if (Config.dashboard.weatherLocation)
|
if (Config.services.weatherLocation)
|
||||||
loc = Config.dashboard.weatherLocation;
|
loc = Config.services.weatherLocation;
|
||||||
else if (!loc || timer.elapsed() > 900)
|
else if (!loc || timer.elapsed() > 900)
|
||||||
Requests.get("https://ipinfo.io/json", text => {
|
Requests.get("https://ipinfo.io/json", text => {
|
||||||
loc = JSON.parse(text).loc ?? "";
|
loc = JSON.parse(text).loc ?? "";
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue