update module

This commit is contained in:
Zacharias-Brohn
2025-10-13 21:41:37 +02:00
parent 5297e81ca6
commit f08ef0ddb6
5 changed files with 167 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
pragma Singleton
pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Modules
Singleton {
property int availableUpdates: 0
Timer {
interval: 1
running: true
repeat: true
onTriggered: {
console.log("Checking for updates...")
updatesProc.running = true
interval = 60000
}
}
Process {
id: updatesProc
running: false
command: ["checkupdates"]
stdout: StdioCollector {
onStreamFinished: {
const output = this.text
const lines = output.trim().split("\n")
console.log("Available updates:", lines)
availableUpdates = lines.length
}
}
}
}
+45
View File
@@ -0,0 +1,45 @@
import QtQuick
import QtQuick.Layouts
import qs.Modules
Item {
id: root
required property int countUpdates
implicitWidth: 60
implicitHeight: 22
Rectangle {
anchors.fill: parent
radius: height / 2
color: "#40000000"
}
RowLayout {
anchors {
fill: parent
leftMargin: 5
rightMargin: 5
}
Text {
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
font.family: "Material Symbols Rounded"
font.pixelSize: 18
text: "\uf569"
color: "#ffffff"
}
Item {
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
implicitWidth: 18
implicitHeight: root.implicitHeight
Text {
anchors.centerIn: parent
text: root.countUpdates
color: "white"
}
}
}
}