memory usage

This commit is contained in:
Benjamin Palko 2025-07-24 11:08:40 -04:00
parent f342c17444
commit bcd6b3c595
4 changed files with 57 additions and 19 deletions

View file

@ -13,6 +13,7 @@ Singleton {
property Clock clock: Clock {}
property Pipewire pipewire: Pipewire {}
property Storage storage: Storage {}
property Memory memory: Memory {}
property Cpu cpu: Cpu {}
property Caffeine caffeine: Caffeine {}
property Workspace workspace: Workspace {}
@ -20,8 +21,6 @@ Singleton {
property TrayMenu trayMenu: TrayMenu {}
component Bar: QtObject {
id: bar
property int spacing: 8
property int border: 2
property int height: 50
@ -32,8 +31,6 @@ Singleton {
}
component Mpris: QtObject {
id: clock
property int fontSize: 14
property int height: 30
property int horizontalPadding: 8
@ -41,8 +38,6 @@ Singleton {
}
component Clock: QtObject {
id: clock
property int fontSize: 14
property int height: 30
property int horizontalPadding: 8
@ -50,8 +45,6 @@ Singleton {
}
component Pipewire: QtObject {
id: clock
property int fontSize: 14
property int height: 30
property int horizontalPadding: 8
@ -59,8 +52,14 @@ Singleton {
}
component Storage: QtObject {
id: clock
property int iconSize: 14
property int fontSize: 14
property int height: 30
property int horizontalPadding: 8
property int verticalPadding: 6
}
component Memory: QtObject {
property int iconSize: 14
property int fontSize: 14
property int height: 30
@ -69,8 +68,6 @@ Singleton {
}
component Cpu: QtObject {
id: clock
property int iconSize: 14
property int fontSize: 14
property int height: 30
@ -79,8 +76,6 @@ Singleton {
}
component Caffeine: QtObject {
id: clock
property int fontSize: 16
property int height: 30
property int horizontalPadding: 8
@ -88,8 +83,6 @@ Singleton {
}
component Workspace: QtObject {
id: workspace
property int spacing: 5
property int iconSize: 16
property int width: 30
@ -99,8 +92,6 @@ Singleton {
}
component Tray: QtObject {
id: tray
property int spacing: 5
property int iconSize: 18
property int width: 30
@ -110,8 +101,6 @@ Singleton {
}
component TrayMenu: QtObject {
id: trayItem
property int fontSize: 10
property int width: 30
property int height: 30

View file

@ -7,6 +7,7 @@ Singleton {
property string coffee: "\u{E09a}"
property string cpu: "\u{E0ad}"
property string hardDrive: "\u{E0f1}"
property string memoryStick: "\u{E44a}"
property string triangle: "\u{E192}"
property string triangleDashed: "\u{E642}"
}

View file

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

View file

@ -0,0 +1,44 @@
import QtQuick
import Quickshell
import "../../../config/"
import "../../../constants/"
import "../../../services/"
import "../../../styled/"
import "../../../utils/"
StyledLabel {
implicitWidth: childrenRect.width
implicitHeight: Dimensions.memory.height
Ref {
service: SystemInfo
}
Row {
StyledText {
id: icon
font.family: Theme.lucide.font.family
font.pixelSize: Dimensions.memory.iconSize
font.bold: true
text: Icons.memoryStick
anchors.verticalCenter: parent.verticalCenter
topPadding: Dimensions.memory.verticalPadding
bottomPadding: Dimensions.memory.verticalPadding
leftPadding: Dimensions.memory.horizontalPadding
}
StyledText {
id: text
anchors.verticalCenter: parent.verticalCenter
topPadding: Dimensions.memory.verticalPadding
bottomPadding: Dimensions.memory.verticalPadding
rightPadding: Dimensions.memory.horizontalPadding
font.pixelSize: Dimensions.memory.fontSize
text: ` ${(SystemInfo.memPerc * 100).toFixed()}%`
}
}
}