parent
a1da662c38
commit
4fe6ff22f6
2 changed files with 8 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ import Quickshell.Io
|
|||
JsonObject {
|
||||
property int mediaUpdateInterval: 500
|
||||
property int visualiserBars: 45
|
||||
property string weatherLocation: "" // A lat,long pair, e.g. "37.8267,-122.4233"
|
||||
|
||||
property JsonObject sizes: JsonObject {
|
||||
readonly property int tabIndicatorHeight: 3
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
pragma Singleton
|
||||
|
||||
import "root:/config"
|
||||
import "root:/utils"
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import QtQuick
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
|
@ -13,15 +15,18 @@ Singleton {
|
|||
property real temperature
|
||||
|
||||
function reload(): void {
|
||||
wttrProc.running = true;
|
||||
if (Config.dashboard.weatherLocation)
|
||||
loc = Config.dashboard.weatherLocation;
|
||||
else
|
||||
ipProc.running = true;
|
||||
}
|
||||
|
||||
onLocChanged: wttrProc.running = true
|
||||
Component.onCompleted: reload()
|
||||
|
||||
Process {
|
||||
id: ipProc
|
||||
|
||||
running: true
|
||||
command: ["curl", "ipinfo.io"]
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: root.loc = JSON.parse(text).loc
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue