initial commit
This commit is contained in:
commit
9fde6d4fc6
27 changed files with 1110 additions and 0 deletions
37
modules/Weather.qml
Normal file
37
modules/Weather.qml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import "." as M
|
||||
|
||||
Text {
|
||||
id: root
|
||||
|
||||
property string label: ""
|
||||
|
||||
Process {
|
||||
id: proc
|
||||
running: true
|
||||
command: ["wttrbar", "--nerd"]
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
try {
|
||||
const data = JSON.parse(text);
|
||||
root.label = data.text ?? "";
|
||||
} catch (e) {
|
||||
root.label = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Timer {
|
||||
interval: 3600000
|
||||
running: true
|
||||
repeat: true
|
||||
onTriggered: proc.running = true
|
||||
}
|
||||
|
||||
text: root.label
|
||||
color: M.Theme.base05
|
||||
font.pixelSize: M.Theme.fontSize
|
||||
font.family: M.Theme.fontFamily
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue