From f01658cd6da6ccfab9b59478d427511d4179c383 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 12 Jul 2025 23:57:06 +0800 Subject: finallyt fucking finished unstyled bar (also no interactivity) --- bar/Bar.qml | 4 ++++ bar/Power.qml | 21 ++++++++++++++++++--- components/SimpleResource.qml | 1 + config/Icons.qml | 2 +- services/Resource.qml | 8 ++++---- 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/bar/Bar.qml b/bar/Bar.qml index df4c081..0591152 100644 --- a/bar/Bar.qml +++ b/bar/Bar.qml @@ -76,6 +76,10 @@ Scope { implicitWidth: (child.width - centerRow.width) / 2 implicitHeight: child.height + Power { + Layout.fillHeight: true + Layout.fillWidth: true + } TimeDate { Layout.fillHeight: true Layout.fillWidth: true diff --git a/bar/Power.qml b/bar/Power.qml index 93da141..f9a74ed 100644 --- a/bar/Power.qml +++ b/bar/Power.qml @@ -4,6 +4,7 @@ import QtQuick.Layouts import qs.services as Services import qs.utils import qs.config as Config +import qs.components Item { id: root @@ -15,11 +16,25 @@ Item { spacing: Config.Bar.resourceIconTextSpacing Icons { - text: Config.Icons.resource.clock + text: Config.Icons.power.shutdown } - Text { - text: Services.TimeDate.time + + Icons { + text: Config.Icons.power.dpms + } + + Icons { + text: Config.Icons.power.lock + } + + Icons { + text: Config.Icons.power.suspend + } + + Icons { + text: Config.Icons.power.reboot } + Item { Layout.fillWidth: true } diff --git a/components/SimpleResource.qml b/components/SimpleResource.qml index 786e37b..2d8a91f 100644 --- a/components/SimpleResource.qml +++ b/components/SimpleResource.qml @@ -20,6 +20,7 @@ RowLayout { Text { text: root.text } + Item { Layout.fillWidth: true } diff --git a/config/Icons.qml b/config/Icons.qml index 13deee9..d628b43 100644 --- a/config/Icons.qml +++ b/config/Icons.qml @@ -61,6 +61,6 @@ Singleton { dpms: "󰶐", lock: "󰍁", suspend: "󰤄", - restart: "" + reboot: "" }) } diff --git a/services/Resource.qml b/services/Resource.qml index b45538b..d2ab9af 100644 --- a/services/Resource.qml +++ b/services/Resource.qml @@ -63,8 +63,8 @@ Singleton { const cpuTempText = fileCpuThermal.text(); cpuTemp = cpuTempText ? parseInt(cpuTempText.trim()) / 100000 : 0; - gpuUsageProcess.running = true; - gpuTempProcess.running = true; + gpuUsageProc.running = true; + gpuTempProc.running = true; interval = General.resourceUpdateInterval * 1000; } } @@ -83,7 +83,7 @@ Singleton { } // nvidia-smi may be dead if firmware update so ABI break etc. Process { - id: gpuUsageProcess + id: gpuUsageProc running: true command: ["nvidia-smi", "--query-gpu=utilization.gpu", "--format=csv,noheader,nounits"] stdout: StdioCollector { @@ -93,7 +93,7 @@ Singleton { } } Process { - id: gpuTempProcess + id: gpuTempProc running: true command: ["nvidia-smi", "--query-gpu=temperature.gpu", "--format=csv,noheader,nounits"] stdout: StdioCollector { -- cgit v1.2.3