summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-07-12 23:57:06 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-07-12 23:57:06 +0800
commitf01658cd6da6ccfab9b59478d427511d4179c383 (patch)
tree268088f8c6071a85b64ea3fa333f4a675de95954
parent1c259d7878c00592916dc6acdb6e22771b22bbf1 (diff)
finallyt fucking finished unstyled bar (also no interactivity)
-rw-r--r--bar/Bar.qml4
-rw-r--r--bar/Power.qml21
-rw-r--r--components/SimpleResource.qml1
-rw-r--r--config/Icons.qml2
-rw-r--r--services/Resource.qml8
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 {