From f08ef0ddb662f55e6cffffc31dee33b6e2bffecd Mon Sep 17 00:00:00 2001 From: Zacharias-Brohn Date: Mon, 13 Oct 2025 21:41:37 +0200 Subject: [PATCH] update module --- Bar.qml | 8 +++++ Modules/Updates.qml | 37 ++++++++++++++++++++ Modules/UpdatesWidget.qml | 45 ++++++++++++++++++++++++ scripts/update.sh | 3 ++ updates.txt | 74 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 167 insertions(+) create mode 100644 Modules/Updates.qml create mode 100644 Modules/UpdatesWidget.qml create mode 100755 scripts/update.sh create mode 100644 updates.txt diff --git a/Bar.qml b/Bar.qml index 9bfddee..ce0cd79 100644 --- a/Bar.qml +++ b/Bar.qml @@ -62,6 +62,14 @@ Scope { Layout.topMargin: 6 Layout.bottomMargin: 6 } + + UpdatesWidget { + Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft + Layout.fillHeight: true + Layout.topMargin: 6 + Layout.bottomMargin: 6 + countUpdates: Updates.availableUpdates + } } RowLayout { diff --git a/Modules/Updates.qml b/Modules/Updates.qml new file mode 100644 index 0000000..1d904a3 --- /dev/null +++ b/Modules/Updates.qml @@ -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 + } + } + } +} diff --git a/Modules/UpdatesWidget.qml b/Modules/UpdatesWidget.qml new file mode 100644 index 0000000..01ddd2d --- /dev/null +++ b/Modules/UpdatesWidget.qml @@ -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" + } + } + } +} diff --git a/scripts/update.sh b/scripts/update.sh new file mode 100755 index 0000000..e899657 --- /dev/null +++ b/scripts/update.sh @@ -0,0 +1,3 @@ +#!/bin/zsh + +exec yay -Sy diff --git a/updates.txt b/updates.txt new file mode 100644 index 0000000..5d49165 --- /dev/null +++ b/updates.txt @@ -0,0 +1,74 @@ +kcodecs 6.18.0-1.1 -> 6.19.0-1.1 +kguiaddons 6.18.0-3.1 -> 6.19.0-1.1 +syndication 6.18.0-1.1 -> 6.19.0-1.1 +kcmutils 6.18.0-1.1 -> 6.19.0-1.1 +bluez-qt 6.18.0-1.1 -> 6.19.0-1.1 +kitemmodels 6.18.0-1.1 -> 6.19.0-1.1 +kconfigwidgets 6.18.0-1.1 -> 6.19.0-1.1 +kcoreaddons 6.18.0-2.1 -> 6.19.0-1.1 +kdbusaddons 6.18.0-1.1 -> 6.19.0-1.1 +knotifyconfig 6.18.0-1.1 -> 6.19.0-1.1 +libqalculate 5.7.0-1.1 -> 5.8.0-1.1 +kcalendarcore 6.18.0-1.1 -> 6.19.0-1.1 +kunitconversion 6.18.0-2.1 -> 6.19.0-1.1 +kjobwidgets 6.18.0-2.1 -> 6.19.0-1.1 +kquickcharts 6.18.0-1.1 -> 6.19.0-1.1 +kcrash 6.18.0-1.1 -> 6.19.0-1.1 +kcontacts 1:6.18.0-1.1 -> 1:6.19.0-1.1 +networkmanager-qt 6.18.0-1.1 -> 6.19.0-1.1 +prison 6.18.0-1.1 -> 6.19.0-1.1 +kstatusnotifieritem 6.18.0-2.1 -> 6.19.0-1.1 +syntax-highlighting 6.18.0-1.1 -> 6.19.0-1.1 +kded 6.18.0-1.1 -> 6.19.0-1.1 +kholidays 1:6.18.0-1.1 -> 1:6.19.0-1.1 +frameworkintegration 6.18.0-2.1 -> 6.19.0-1.1 +kdnssd 6.18.0-1.1 -> 6.19.0-1.1 +extra-cmake-modules 6.18.0-1 -> 6.19.0-1 +seabios 1.17.0-1 -> 1.17.0-2 +frei0r-plugins 2.4.0-1.1 -> 2.5.0-1 +kdav 1:6.18.0-1.1 -> 1:6.19.0-1.1 +kauth 6.18.0-1.1 -> 6.19.0-1.1 +karchive 6.18.0-1.1 -> 6.19.0-1.1 +kbookmarks 6.18.0-1.1 -> 6.19.0-1.1 +kcompletion 6.18.0-1.1 -> 6.19.0-1.1 +kirigami 6.18.0-1.1 -> 6.19.0-1.1 +kdeclarative 6.18.0-1.1 -> 6.19.0-1.1 +baloo 6.18.0-1.1 -> 6.19.0-1.1 +kiconthemes 6.18.0-1.1 -> 6.19.0-1.1 +kidletime 6.18.0-2.1 -> 6.19.0-1.1 +sonnet 6.18.0-1.1 -> 6.19.0-1.1 +ki18n 6.18.0-1.1 -> 6.19.0-1.1 +kxmlgui 6.18.0-2.1 -> 6.19.0-1.1 +grub 2:2.12.r359.g19c698d12-1 -> 2:2.12.r418.g6b5c671d-1 +modemmanager-qt 6.18.0-1.1 -> 6.19.0-1.1 +breeze-icons 6.18.0-1.1 -> 6.19.0-1.1 +qqc2-desktop-style 6.18.0-1.1 -> 6.19.0-1.1 +kdesu 6.18.0-1.1 -> 6.19.0-1.1 +ncnn 20250916-2.1 -> 20250916-3.1 +ktexteditor 6.18.0-1.1 -> 6.19.0-1.1 +kwindowsystem 6.18.0-2.1 -> 6.19.0-1.1 +krunner 6.18.0-1.1 -> 6.19.0-1.1 +knotifications 6.18.0-2.1 -> 6.19.0-1.1 +kio 6.18.0-1.1 -> 6.19.0-1.1 +brltty 6.7-5.1 -> 6.8-1.1 +kcolorscheme 6.18.0-1.1 -> 6.19.0-1.1 +ktexttemplate 6.18.0-1.1 -> 6.19.0-1.1 +kuserfeedback 6.18.0-1.1 -> 6.19.0-1.1 +kitemviews 6.18.0-1.1 -> 6.19.0-1.1 +kglobalaccel 6.18.0-1.1 -> 6.19.0-1.1 +kpty 6.18.0-1.1 -> 6.19.0-1.1 +kpackage 6.18.0-1.1 -> 6.19.0-1.1 +imagemagick 7.1.2.5-1.1 -> 7.1.2.6-1.1 +solid 6.18.0-1.1 -> 6.19.0-1.1 +attica 6.18.0-1.1 -> 6.19.0-1.1 +knewstuff 6.18.0-1.1 -> 6.19.0-1.1 +kwallet 6.18.0-1.1 -> 6.19.0-1.1 +kservice 6.18.0-1.1 -> 6.19.0-1.1 +python-jellyfish 1.2.0-1.1 -> 1.2.1-1.1 +kparts 6.18.0-1.1 -> 6.19.0-1.1 +kconfig 6.18.0-1.1 -> 6.19.0-1.1 +ksvg 6.18.0-1.1 -> 6.19.0-1.1 +kfilemetadata 6.18.0-2.1 -> 6.19.0-1.1 +purpose 6.18.0-1.1 -> 6.19.0-1.1 +kwidgetsaddons 6.18.0-2.1 -> 6.19.0-1.1 +ktextwidgets 6.18.0-1.1 -> 6.19.0-1.1