Compare commits

..

2 commits

Author SHA1 Message Date
Benjamin Palko
f342c17444 add cpu perc/temp 2025-07-24 11:03:06 -04:00
Benjamin Palko
743374628a add storage 2025-07-24 10:55:29 -04:00
5 changed files with 82 additions and 6 deletions

View file

@ -13,6 +13,7 @@ Singleton {
property Clock clock: Clock {} property Clock clock: Clock {}
property Pipewire pipewire: Pipewire {} property Pipewire pipewire: Pipewire {}
property Storage storage: Storage {} property Storage storage: Storage {}
property Cpu cpu: Cpu {}
property Caffeine caffeine: Caffeine {} property Caffeine caffeine: Caffeine {}
property Workspace workspace: Workspace {} property Workspace workspace: Workspace {}
property Tray tray: Tray {} property Tray tray: Tray {}
@ -67,6 +68,16 @@ Singleton {
property int verticalPadding: 6 property int verticalPadding: 6
} }
component Cpu: QtObject {
id: clock
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 {
id: clock id: clock

View file

@ -5,6 +5,7 @@ import Quickshell
Singleton { 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 hardDrive: "\u{E0f1}" property string hardDrive: "\u{E0f1}"
property string triangle: "\u{E192}" property string triangle: "\u{E192}"
property string triangleDashed: "\u{E642}" property string triangleDashed: "\u{E642}"

View file

@ -108,6 +108,10 @@ Scope {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
Cpu {
anchors.verticalCenter: parent.verticalCenter
}
Clock { Clock {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }

View 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: true
implicitWidth: row.width
implicitHeight: Dimensions.storage.height
Ref {
service: SystemInfo
}
onClicked: {
root.showTemp = !root.showTemp;
}
Row {
id: row
StyledText {
id: icon
font.family: Theme.lucide.font.family
font.pixelSize: Dimensions.storage.iconSize
font.bold: true
text: Icons.cpu
anchors.verticalCenter: parent.verticalCenter
topPadding: Dimensions.storage.verticalPadding
bottomPadding: Dimensions.storage.verticalPadding
leftPadding: Dimensions.storage.horizontalPadding
}
StyledText {
id: text
anchors.verticalCenter: parent.verticalCenter
topPadding: Dimensions.storage.verticalPadding
bottomPadding: Dimensions.storage.verticalPadding
rightPadding: Dimensions.storage.horizontalPadding
font.pixelSize: Dimensions.storage.fontSize
text: ` ${(SystemInfo.cpuPerc * 100).toFixed()}%`
states: [
State {
name: "temp"
when: root.showTemp
PropertyChanges {
text {
text: ` ${(SystemInfo.cpuTemp)}`
}
}
}
]
}
}
}

View file

@ -11,7 +11,7 @@ StyledLabel {
implicitHeight: Dimensions.storage.height implicitHeight: Dimensions.storage.height
Ref { Ref {
service: SystemInfo service: SystemInfo
} }
Row { Row {
@ -39,11 +39,6 @@ StyledLabel {
font.pixelSize: Dimensions.storage.fontSize font.pixelSize: Dimensions.storage.fontSize
text: ` ${(SystemInfo.storagePerc * 100).toFixed()}%` text: ` ${(SystemInfo.storagePerc * 100).toFixed()}%`
SystemClock {
id: clock
precision: SystemClock.Seconds
}
} }
} }
} }