gpu temp/usage
This commit is contained in:
parent
3a2fae13a2
commit
35d2addd70
4 changed files with 79 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ Singleton {
|
||||||
property Storage storage: Storage {}
|
property Storage storage: Storage {}
|
||||||
property Memory memory: Memory {}
|
property Memory memory: Memory {}
|
||||||
property Cpu cpu: Cpu {}
|
property Cpu cpu: Cpu {}
|
||||||
|
property Gpu gpu: Gpu {}
|
||||||
property Caffeine caffeine: Caffeine {}
|
property Caffeine caffeine: Caffeine {}
|
||||||
property Workspace workspace: Workspace {}
|
property Workspace workspace: Workspace {}
|
||||||
property Tray tray: Tray {}
|
property Tray tray: Tray {}
|
||||||
|
|
@ -75,6 +76,14 @@ Singleton {
|
||||||
property int verticalPadding: 6
|
property int verticalPadding: 6
|
||||||
}
|
}
|
||||||
|
|
||||||
|
component Gpu: QtObject {
|
||||||
|
property int iconSize: 14
|
||||||
|
property int fontSize: 14
|
||||||
|
property int height: 30
|
||||||
|
property int horizontalPadding: 8
|
||||||
|
property int verticalPadding: 6
|
||||||
|
}
|
||||||
|
|
||||||
component Caffeine: QtObject {
|
component Caffeine: QtObject {
|
||||||
property int fontSize: 16
|
property int fontSize: 16
|
||||||
property int height: 30
|
property int height: 30
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ Singleton {
|
||||||
property string brickWall: "\u{E586}"
|
property string brickWall: "\u{E586}"
|
||||||
property string coffee: "\u{E09a}"
|
property string coffee: "\u{E09a}"
|
||||||
property string cpu: "\u{E0ad}"
|
property string cpu: "\u{E0ad}"
|
||||||
|
property string gpu: "\u{E66f}"
|
||||||
property string hardDrive: "\u{E0f1}"
|
property string hardDrive: "\u{E0f1}"
|
||||||
property string memoryStick: "\u{E44a}"
|
property string memoryStick: "\u{E44a}"
|
||||||
property string triangle: "\u{E192}"
|
property string triangle: "\u{E192}"
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,10 @@ Scope {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gpu {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
Clock {
|
Clock {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
|
||||||
65
modules/bar/components/Gpu.qml
Normal file
65
modules/bar/components/Gpu.qml
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import "../../../config/"
|
||||||
|
import "../../../constants/"
|
||||||
|
import "../../../services/"
|
||||||
|
import "../../../styled/"
|
||||||
|
import "../../../utils/"
|
||||||
|
|
||||||
|
Clickable {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property bool showTemp: false
|
||||||
|
|
||||||
|
implicitWidth: row.width
|
||||||
|
implicitHeight: Dimensions.gpu.height
|
||||||
|
|
||||||
|
Ref {
|
||||||
|
service: SystemInfo
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
root.showTemp = !root.showTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: row
|
||||||
|
StyledText {
|
||||||
|
id: icon
|
||||||
|
|
||||||
|
font.family: Theme.lucide.font.family
|
||||||
|
font.pixelSize: Dimensions.gpu.iconSize
|
||||||
|
font.bold: true
|
||||||
|
text: Icons.gpu
|
||||||
|
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
topPadding: Dimensions.gpu.verticalPadding
|
||||||
|
bottomPadding: Dimensions.gpu.verticalPadding
|
||||||
|
leftPadding: Dimensions.gpu.horizontalPadding
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
id: text
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
topPadding: Dimensions.gpu.verticalPadding
|
||||||
|
bottomPadding: Dimensions.gpu.verticalPadding
|
||||||
|
rightPadding: Dimensions.gpu.horizontalPadding
|
||||||
|
|
||||||
|
font.pixelSize: Dimensions.gpu.fontSize
|
||||||
|
|
||||||
|
text: ` ${(SystemInfo.gpuPerc * 100).toFixed()}%`
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "temp"
|
||||||
|
when: root.showTemp
|
||||||
|
PropertyChanges {
|
||||||
|
text {
|
||||||
|
text: ` ${(SystemInfo.gpuTemp)}℃`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue