fixes waybar, adds quickshell
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
// modules/WeatherWidget.qml - wttr.in one-liner, refreshed hourly
|
||||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import ".."
|
||||
|
||||
Pill {
|
||||
id: root
|
||||
property string weatherText: "..."
|
||||
|
||||
Text {
|
||||
text: weatherText
|
||||
font { family: Theme.fontSans; pixelSize: Theme.fontSize }
|
||||
color: Theme.foreground
|
||||
}
|
||||
|
||||
// ── Fetch via curl ────────────────────────────────────────
|
||||
Process {
|
||||
id: curl
|
||||
command: ["curl", "-s", "--max-time", "8", "https://wttr.in/?format=1"]
|
||||
running: false
|
||||
stdout: SplitParser {
|
||||
onRead: (line) => root.weatherText = line.trim()
|
||||
}
|
||||
onExited: curl.running = false
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 3600000 // 1 hour
|
||||
running: true
|
||||
repeat: true
|
||||
triggeredOnStart: true
|
||||
onTriggered: curl.running = true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user